Fix wrapWidth for channels on small screens
This commit is contained in:
parent
bb8a4d180e
commit
e19280c2c7
File diff suppressed because one or more lines are too long
@ -1,12 +1,21 @@
|
||||
const lineHeight = 24;
|
||||
let prevWidth;
|
||||
let windowWidth;
|
||||
|
||||
export default function messageHeight(message, width, charWidth, indent = 0) {
|
||||
let pad = (6 + (message.from ? message.from.length + 1 : 0)) * charWidth;
|
||||
let height = lineHeight + 4;
|
||||
|
||||
if (message.channel) {
|
||||
if (width !== prevWidth) {
|
||||
prevWidth = width;
|
||||
windowWidth = window.innerWidth;
|
||||
}
|
||||
|
||||
if (windowWidth > 600) {
|
||||
width -= 200;
|
||||
}
|
||||
}
|
||||
|
||||
if (pad + (message.message.length * charWidth) < width) {
|
||||
return height;
|
||||
|
Loading…
Reference in New Issue
Block a user