Improve warp

This commit is contained in:
syuilo
2019-04-18 22:00:11 +09:00
parent 8aaab195c6
commit fda8cf77ed
7 changed files with 47 additions and 7 deletions

View File

@@ -36,6 +36,7 @@ export default Vue.extend({
includeReplies: this.mode == 'with-replies',
includeMyRenotes: this.mode != 'my-posts',
withFiles: this.mode == 'with-media',
untilDate: cursor ? undefined : (this.date ? this.date.getTime() : undefined),
untilId: cursor ? cursor : undefined
}).then(notes => {
if (notes.length == fetchLimit + 1) {
@@ -62,10 +63,11 @@ export default Vue.extend({
mounted() {
document.addEventListener('keydown', this.onDocumentKeydown);
},
beforeDestroy() {
document.removeEventListener('keydown', this.onDocumentKeydown);
this.$root.$on('warp', this.warp);
this.$once('hook:beforeDestroy', () => {
this.$root.$off('warp', this.warp);
document.removeEventListener('keydown', this.onDocumentKeydown);
});
},
methods: {