summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-26 23:37:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-26 23:37:40 +0900
commit100557e975a0aab19d0fa42e552ac5bf7882a65f (patch)
tree9cede709a993cecfec738282269907210bc307f9 /src
parentDarken (diff)
downloadmisskey-100557e975a0aab19d0fa42e552ac5bf7882a65f.tar.gz
misskey-100557e975a0aab19d0fa42e552ac5bf7882a65f.tar.bz2
misskey-100557e975a0aab19d0fa42e552ac5bf7882a65f.zip
Fix bug
Diffstat (limited to 'src')
-rw-r--r--src/client/app/mobile/views/components/user-list-timeline.vue18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/app/mobile/views/components/user-list-timeline.vue b/src/client/app/mobile/views/components/user-list-timeline.vue
index 59d6abbbc1..c0ba995b68 100644
--- a/src/client/app/mobile/views/components/user-list-timeline.vue
+++ b/src/client/app/mobile/views/components/user-list-timeline.vue
@@ -12,6 +12,7 @@ const fetchLimit = 10;
export default Vue.extend({
props: ['list'],
+
data() {
return {
fetching: true,
@@ -20,15 +21,25 @@ export default Vue.extend({
connection: null
};
},
+
+ computed: {
+ canFetchMore(): boolean {
+ return !this.moreFetching && !this.fetching && this.existMore;
+ }
+ },
+
watch: {
$route: 'init'
},
+
mounted() {
this.init();
},
+
beforeDestroy() {
this.connection.close();
},
+
methods: {
init() {
if (this.connection) this.connection.close();
@@ -39,6 +50,7 @@ export default Vue.extend({
this.fetch();
},
+
fetch() {
this.fetching = true;
@@ -59,7 +71,10 @@ export default Vue.extend({
}, rej);
}));
},
+
more() {
+ if (!this.canFetchMore) return;
+
this.moreFetching = true;
(this as any).api('notes/user-list-timeline', {
@@ -78,13 +93,16 @@ export default Vue.extend({
this.moreFetching = false;
});
},
+
onNote(note) {
// Prepend a note
(this.$refs.timeline as any).prepend(note);
},
+
onUserAdded() {
this.fetch();
},
+
onUserRemoved() {
this.fetch();
}