やった

This commit is contained in:
syuilo
2018-06-07 06:13:57 +09:00
parent 818bc96aab
commit be9f836b21
13 changed files with 159 additions and 16 deletions

View File

@ -18,6 +18,11 @@ export default Vue.extend({
type: String,
required: false,
default: 'home'
},
mediaOnly: {
type: Boolean,
required: false,
default: false
}
},
@ -31,6 +36,12 @@ export default Vue.extend({
};
},
watch: {
mediaOnly() {
this.fetch();
}
},
computed: {
stream(): any {
return this.src == 'home'
@ -78,6 +89,7 @@ export default Vue.extend({
(this.$refs.timeline as any).init(() => new Promise((res, rej) => {
(this as any).api(this.endpoint, {
limit: fetchLimit + 1,
mediaOnly: this.mediaOnly,
includeMyRenotes: this.$store.state.settings.showMyRenotes,
includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes
}).then(notes => {
@ -97,6 +109,7 @@ export default Vue.extend({
const promise = (this as any).api(this.endpoint, {
limit: fetchLimit + 1,
mediaOnly: this.mediaOnly,
untilId: (this.$refs.timeline as any).tail().id,
includeMyRenotes: this.$store.state.settings.showMyRenotes,
includeRenotedMyNotes: this.$store.state.settings.showRenotedMyNotes
@ -116,6 +129,8 @@ export default Vue.extend({
},
onNote(note) {
if (this.mediaOnly && note.media.length == 0) return;
// Prepend a note
(this.$refs.timeline as any).prepend(note);
},