diff options
Diffstat (limited to 'src/client/app')
| -rw-r--r-- | src/client/app/desktop/views/pages/deck/deck.user-column.vue | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/app/desktop/views/pages/deck/deck.user-column.vue b/src/client/app/desktop/views/pages/deck/deck.user-column.vue index 7621ac5edb..6804dd97f1 100644 --- a/src/client/app/desktop/views/pages/deck/deck.user-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.user-column.vue @@ -41,6 +41,7 @@ import parseAcct from '../../../../../../misc/acct/parse'; import XColumn from './deck.column.vue'; import XNotes from './deck.notes.vue'; import XNote from '../../components/note.vue'; +import { concat } from '../../../../../../prelude/array'; const fetchLimit = 10; @@ -93,17 +94,24 @@ export default Vue.extend({ (this.$refs.timeline as any).init(() => this.initTl()); }); + const image = [ + 'image/jpeg', + 'image/png', + 'image/gif' + ]; + (this as any).api('users/notes', { userId: this.user.id, - withFiles: true, + fileType: image, limit: 9 }).then(notes => { notes.forEach(note => { note.files.forEach(file => { file._note = note; - if (this.images.length < 9) this.images.push(file); }); }); + const files = concat(notes.map((n: any): any[] => n.files)); + this.images = files.filter(f => image.includes(f.type)).slice(0, 6); }); }); }, |