This commit is contained in:
syuilo
2018-10-19 09:20:11 +09:00
parent 0a4015b8a2
commit 8533663b26
2 changed files with 26 additions and 3 deletions

View File

@ -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);
});
});
},