添付されたメディアのURLは省略して表示するように
This commit is contained in:
parent
e1672e539b
commit
89a58dc596
4 changed files with 47 additions and 3 deletions
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue