添付されたメディアのURLは省略して表示するように
This commit is contained in:
16
src/client/app/common/scripts/can-hide-text.ts
Normal file
16
src/client/app/common/scripts/can-hide-text.ts
Normal file
@ -0,0 +1,16 @@
|
||||
export default function(note) {
|
||||
if (note.text == null) return true;
|
||||
|
||||
let txt = note.text;
|
||||
|
||||
if (note.media) {
|
||||
note.media.forEach(file => {
|
||||
txt = txt.replace(file.url, '');
|
||||
if (file.src) txt = txt.replace(file.src, '');
|
||||
});
|
||||
|
||||
if (txt == '') return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user