fix(frontend): fix lint (#15906)
* fix(frontend): attempt to fix lint * fix lint
This commit is contained in:
parent
41f09fa272
commit
f8b0863b8e
|
@ -6,17 +6,30 @@
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
|
||||||
export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean {
|
export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean {
|
||||||
const collapsed = note.cw == null && (
|
if (note.cw != null) {
|
||||||
(note.text != null && (
|
return false;
|
||||||
(note.text.includes('$[x2')) ||
|
}
|
||||||
(note.text.includes('$[x3')) ||
|
|
||||||
(note.text.includes('$[x4')) ||
|
|
||||||
(note.text.includes('$[scale')) ||
|
|
||||||
(note.text.split('\n').length > 9) ||
|
|
||||||
(note.text.length > 500) ||
|
|
||||||
(urls.length >= 4)
|
|
||||||
)) || (note.files != null && note.files.length >= 5)
|
|
||||||
);
|
|
||||||
|
|
||||||
return collapsed;
|
if (note.text != null) {
|
||||||
|
if (
|
||||||
|
note.text.includes('$[x2') ||
|
||||||
|
note.text.includes('$[x3') ||
|
||||||
|
note.text.includes('$[x4') ||
|
||||||
|
note.text.includes('$[scale') ||
|
||||||
|
note.text.split('\n').length > 9 ||
|
||||||
|
note.text.length > 500
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (urls.length >= 4) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (note.files != null && note.files.length >= 5) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ export function maybeMakeRelative(urlStr: string, baseStr: string): string {
|
||||||
return urlObj.pathname + urlObj.search + urlObj.hash;
|
return urlObj.pathname + urlObj.search + urlObj.hash;
|
||||||
}
|
}
|
||||||
return urlStr;
|
return urlStr;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue