summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-08 14:17:44 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-08 14:17:44 +0900
commit1e166490d9bd76cde3b0acaed8c678761b745e5e (patch)
tree267f23191db2131a34352907a8cf413130acbbb4 /src/client
parenti18n (diff)
downloadmisskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.tar.gz
misskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.tar.bz2
misskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.zip
[Client] Better pagination
Fix #4628 Close #4629
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/views/components/user-list.vue2
-rw-r--r--src/client/app/common/views/deck/deck.direct.vue4
-rw-r--r--src/client/app/common/views/deck/deck.favorites-column.vue4
-rw-r--r--src/client/app/common/views/deck/deck.hashtag-tl.vue4
-rw-r--r--src/client/app/common/views/deck/deck.list-tl.vue4
-rw-r--r--src/client/app/common/views/deck/deck.mentions.vue4
-rw-r--r--src/client/app/common/views/deck/deck.notes.vue13
-rw-r--r--src/client/app/common/views/deck/deck.search-column.vue2
-rw-r--r--src/client/app/common/views/deck/deck.tl.vue4
-rw-r--r--src/client/app/common/views/deck/deck.user-column.home.vue4
-rw-r--r--src/client/app/common/views/pages/followers.vue2
-rw-r--r--src/client/app/common/views/pages/following.vue2
-rw-r--r--src/client/app/desktop/views/components/notes.vue13
-rw-r--r--src/client/app/desktop/views/components/user-list-timeline.vue4
-rw-r--r--src/client/app/desktop/views/home/search.vue2
-rw-r--r--src/client/app/desktop/views/home/tag.vue2
-rw-r--r--src/client/app/desktop/views/home/timeline.core.vue4
-rw-r--r--src/client/app/desktop/views/home/user/user.timeline.vue4
-rw-r--r--src/client/app/mobile/views/components/notes.vue13
-rw-r--r--src/client/app/mobile/views/components/user-list-timeline.vue4
-rw-r--r--src/client/app/mobile/views/components/user-timeline.vue4
-rw-r--r--src/client/app/mobile/views/pages/home.timeline.vue4
-rw-r--r--src/client/app/mobile/views/pages/search.vue6
-rw-r--r--src/client/app/mobile/views/pages/tag.vue6
24 files changed, 59 insertions, 56 deletions
diff --git a/src/client/app/common/views/components/user-list.vue b/src/client/app/common/views/components/user-list.vue
index 4661e48947..b8f4d7d9dc 100644
--- a/src/client/app/common/views/components/user-list.vue
+++ b/src/client/app/common/views/components/user-list.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
fetchingMoreUsers: false,
us: [],
inited: false,
- cursor: null
+ more: false
};
},
diff --git a/src/client/app/common/views/deck/deck.direct.vue b/src/client/app/common/views/deck/deck.direct.vue
index 2618363b14..29db5cb7f3 100644
--- a/src/client/app/common/views/deck/deck.direct.vue
+++ b/src/client/app/common/views/deck/deck.direct.vue
@@ -28,12 +28,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.favorites-column.vue b/src/client/app/common/views/deck/deck.favorites-column.vue
index 238938594f..526b998f87 100644
--- a/src/client/app/common/views/deck/deck.favorites-column.vue
+++ b/src/client/app/common/views/deck/deck.favorites-column.vue
@@ -37,12 +37,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.hashtag-tl.vue b/src/client/app/common/views/deck/deck.hashtag-tl.vue
index b94267b74b..6f89f6a23d 100644
--- a/src/client/app/common/views/deck/deck.hashtag-tl.vue
+++ b/src/client/app/common/views/deck/deck.hashtag-tl.vue
@@ -41,12 +41,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.list-tl.vue b/src/client/app/common/views/deck/deck.list-tl.vue
index d1887990f2..24080ad4ea 100644
--- a/src/client/app/common/views/deck/deck.list-tl.vue
+++ b/src/client/app/common/views/deck/deck.list-tl.vue
@@ -41,12 +41,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.mentions.vue b/src/client/app/common/views/deck/deck.mentions.vue
index 1efd778226..153b4cd052 100644
--- a/src/client/app/common/views/deck/deck.mentions.vue
+++ b/src/client/app/common/views/deck/deck.mentions.vue
@@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.notes.vue b/src/client/app/common/views/deck/deck.notes.vue
index f94eb8fd38..26af7005f0 100644
--- a/src/client/app/common/views/deck/deck.notes.vue
+++ b/src/client/app/common/views/deck/deck.notes.vue
@@ -26,7 +26,7 @@
</template>
</component>
- <footer v-if="cursor != null">
+ <footer v-if="more">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
@@ -61,7 +61,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
- cursor: null
+ more: false
};
},
@@ -119,7 +119,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
- this.cursor = x.cursor;
+ this.more = x.more;
}
this.inited = true;
this.fetching = false;
@@ -130,11 +130,11 @@ export default Vue.extend({
},
more() {
- if (this.cursor == null || this.moreFetching) return;
+ if (!this.more || this.moreFetching) return;
this.moreFetching = true;
- this.makePromise(this.cursor).then(x => {
+ this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
- this.cursor = x.cursor;
+ this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@@ -157,6 +157,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
+ this.more = true;
}
} else {
this.queue.push(note);
diff --git a/src/client/app/common/views/deck/deck.search-column.vue b/src/client/app/common/views/deck/deck.search-column.vue
index fb0ba5f6e4..ab19bdaab6 100644
--- a/src/client/app/common/views/deck/deck.search-column.vue
+++ b/src/client/app/common/views/deck/deck.search-column.vue
@@ -39,7 +39,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/common/views/deck/deck.tl.vue b/src/client/app/common/views/deck/deck.tl.vue
index 5381cfbd5e..83fc149a03 100644
--- a/src/client/app/common/views/deck/deck.tl.vue
+++ b/src/client/app/common/views/deck/deck.tl.vue
@@ -85,12 +85,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
});
diff --git a/src/client/app/common/views/deck/deck.user-column.home.vue b/src/client/app/common/views/deck/deck.user-column.home.vue
index 7a11be536b..56362b78c2 100644
--- a/src/client/app/common/views/deck/deck.user-column.home.vue
+++ b/src/client/app/common/views/deck/deck.user-column.home.vue
@@ -95,12 +95,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
});
diff --git a/src/client/app/common/views/pages/followers.vue b/src/client/app/common/views/pages/followers.vue
index 67cfb8512f..1d68d71e80 100644
--- a/src/client/app/common/views/pages/followers.vue
+++ b/src/client/app/common/views/pages/followers.vue
@@ -30,7 +30,7 @@ export default Vue.extend({
} else {
return {
users: followings.map(following => following.follower),
- cursor: null
+ more: false
};
}
}),
diff --git a/src/client/app/common/views/pages/following.vue b/src/client/app/common/views/pages/following.vue
index 518a63ac1b..b65d335314 100644
--- a/src/client/app/common/views/pages/following.vue
+++ b/src/client/app/common/views/pages/following.vue
@@ -30,7 +30,7 @@ export default Vue.extend({
} else {
return {
users: followings.map(following => following.followee),
- cursor: null
+ more: false
};
}
}),
diff --git a/src/client/app/desktop/views/components/notes.vue b/src/client/app/desktop/views/components/notes.vue
index 4334e78451..c98ac1e9b3 100644
--- a/src/client/app/desktop/views/components/notes.vue
+++ b/src/client/app/desktop/views/components/notes.vue
@@ -25,7 +25,7 @@
</template>
</component>
- <footer v-if="cursor != null">
+ <footer v-if="more">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
@@ -58,7 +58,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
- cursor: null
+ more: false
};
},
@@ -112,7 +112,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
- this.cursor = x.cursor;
+ this.more = x.more;
}
this.inited = true;
this.fetching = false;
@@ -123,11 +123,11 @@ export default Vue.extend({
},
more() {
- if (this.cursor == null || this.moreFetching) return;
+ if (!this.more || this.moreFetching) return;
this.moreFetching = true;
- this.makePromise(this.cursor).then(x => {
+ this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
- this.cursor = x.cursor;
+ this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@@ -157,6 +157,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
+ this.more = true;
}
} else {
this.queue.push(note);
diff --git a/src/client/app/desktop/views/components/user-list-timeline.vue b/src/client/app/desktop/views/components/user-list-timeline.vue
index 6fc75d73fc..0cbe5ff05a 100644
--- a/src/client/app/desktop/views/components/user-list-timeline.vue
+++ b/src/client/app/desktop/views/components/user-list-timeline.vue
@@ -30,12 +30,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/desktop/views/home/search.vue b/src/client/app/desktop/views/home/search.vue
index 1632e730d3..84153d18c4 100644
--- a/src/client/app/desktop/views/home/search.vue
+++ b/src/client/app/desktop/views/home/search.vue
@@ -35,7 +35,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/desktop/views/home/tag.vue b/src/client/app/desktop/views/home/tag.vue
index 98d89955b3..92f5a47528 100644
--- a/src/client/app/desktop/views/home/tag.vue
+++ b/src/client/app/desktop/views/home/tag.vue
@@ -35,7 +35,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/desktop/views/home/timeline.core.vue b/src/client/app/desktop/views/home/timeline.core.vue
index bf07b69dbf..934b1aa787 100644
--- a/src/client/app/desktop/views/home/timeline.core.vue
+++ b/src/client/app/desktop/views/home/timeline.core.vue
@@ -113,12 +113,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
});
diff --git a/src/client/app/desktop/views/home/user/user.timeline.vue b/src/client/app/desktop/views/home/user/user.timeline.vue
index f5d14112db..086ad6a329 100644
--- a/src/client/app/desktop/views/home/user/user.timeline.vue
+++ b/src/client/app/desktop/views/home/user/user.timeline.vue
@@ -42,12 +42,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue
index 7aeebde643..58fc8a6bcf 100644
--- a/src/client/app/mobile/views/components/notes.vue
+++ b/src/client/app/mobile/views/components/notes.vue
@@ -21,7 +21,7 @@
</template>
</component>
- <footer v-if="cursor != null">
+ <footer v-if="more">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
@@ -53,7 +53,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
- cursor: null
+ more: false
};
},
@@ -113,7 +113,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
- this.cursor = x.cursor;
+ this.more = x.more;
}
this.inited = true;
this.fetching = false;
@@ -124,11 +124,11 @@ export default Vue.extend({
},
more() {
- if (this.cursor == null || this.moreFetching) return;
+ if (!this.more || this.moreFetching) return;
this.moreFetching = true;
- this.makePromise(this.cursor).then(x => {
+ this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
- this.cursor = x.cursor;
+ this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@@ -151,6 +151,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
+ this.more = true;
}
} else {
this.queue.push(note);
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 e67d7931f7..c3f09c9b15 100644
--- a/src/client/app/mobile/views/components/user-list-timeline.vue
+++ b/src/client/app/mobile/views/components/user-list-timeline.vue
@@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/mobile/views/components/user-timeline.vue b/src/client/app/mobile/views/components/user-timeline.vue
index 1b73b5bc41..70016a49e3 100644
--- a/src/client/app/mobile/views/components/user-timeline.vue
+++ b/src/client/app/mobile/views/components/user-timeline.vue
@@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/mobile/views/pages/home.timeline.vue b/src/client/app/mobile/views/pages/home.timeline.vue
index 1eb7399979..36aea1ffcd 100644
--- a/src/client/app/mobile/views/pages/home.timeline.vue
+++ b/src/client/app/mobile/views/pages/home.timeline.vue
@@ -114,12 +114,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
- cursor: notes[notes.length - 1].id
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
});
diff --git a/src/client/app/mobile/views/pages/search.vue b/src/client/app/mobile/views/pages/search.vue
index 9e4be82041..f4b2512809 100644
--- a/src/client/app/mobile/views/pages/search.vue
+++ b/src/client/app/mobile/views/pages/search.vue
@@ -21,19 +21,19 @@ export default Vue.extend({
return {
makePromise: cursor => this.$root.api('notes/search', {
limit: limit + 1,
- offset: cursor ? cursor : undefined,
+ untilId: cursor ? cursor : undefined,
query: this.q
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
- cursor: cursor ? cursor + limit : limit
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})
diff --git a/src/client/app/mobile/views/pages/tag.vue b/src/client/app/mobile/views/pages/tag.vue
index 7a7b90dad0..f41cf1f18c 100644
--- a/src/client/app/mobile/views/pages/tag.vue
+++ b/src/client/app/mobile/views/pages/tag.vue
@@ -21,19 +21,19 @@ export default Vue.extend({
return {
makePromise: cursor => this.$root.api('notes/search-by-tag', {
limit: limit + 1,
- offset: cursor ? cursor : undefined,
+ untilId: cursor ? cursor : undefined,
tag: this.$route.params.tag
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
- cursor: cursor ? cursor + limit : limit
+ more: true
};
} else {
return {
notes: notes,
- cursor: null
+ more: false
};
}
})