This commit is contained in:
syuilo
2018-04-16 15:13:31 +09:00
parent 52b74c35f2
commit 8ff8f14d4e
3 changed files with 16 additions and 15 deletions

View File

@ -3,6 +3,7 @@
<header>
<span :data-is-active="mode == 'default'" @click="mode = 'default'">投稿</span>
<span :data-is-active="mode == 'with-replies'" @click="mode = 'with-replies'">投稿と返信</span>
<span :data-is-active="mode == 'with-media'" @click="mode = 'with-media'">メディア</span>
</header>
<div class="loading" v-if="fetching">
<mk-ellipsis-icon/>
@ -31,16 +32,16 @@ export default Vue.extend({
date: null
};
},
watch: {
mode() {
this.fetch();
}
},
computed: {
empty(): boolean {
return this.notes.length == 0;
}
},
watch: {
mode() {
this.fetch();
}
},
mounted() {
document.addEventListener('keydown', this.onDocumentKeydown);
window.addEventListener('scroll', this.onScroll);
@ -63,7 +64,8 @@ export default Vue.extend({
(this as any).api('users/notes', {
userId: this.user.id,
untilDate: this.date ? this.date.getTime() : undefined,
with_replies: this.mode == 'with-replies'
includeReplies: this.mode == 'with-replies',
withMedia: this.mode == 'with-media'
}).then(notes => {
this.notes = notes;
this.fetching = false;
@ -75,7 +77,8 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('users/notes', {
userId: this.user.id,
with_replies: this.mode == 'with-replies',
includeReplies: this.mode == 'with-replies',
withMedia: this.mode == 'with-media',
untilId: this.notes[this.notes.length - 1].id
}).then(notes => {
this.moreFetching = false;