parent
							
								
									1c57e6f80a
								
							
						
					
					
						commit
						1e166490d9
					
				
					 24 changed files with 59 additions and 56 deletions
				
			
		| 
						 | 
				
			
			@ -50,7 +50,7 @@ export default Vue.extend({
 | 
			
		|||
			fetchingMoreUsers: false,
 | 
			
		||||
			us: [],
 | 
			
		||||
			inited: false,
 | 
			
		||||
			cursor: null
 | 
			
		||||
			more: false
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ export default Vue.extend({
 | 
			
		|||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						notes: notes,
 | 
			
		||||
						cursor: null
 | 
			
		||||
						more: false
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ export default Vue.extend({
 | 
			
		|||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						users: followings.map(following => following.follower),
 | 
			
		||||
						cursor: null
 | 
			
		||||
						more: false
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			}),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ export default Vue.extend({
 | 
			
		|||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						users: followings.map(following => following.followee),
 | 
			
		||||
						cursor: null
 | 
			
		||||
						more: false
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			}),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ export default Vue.extend({
 | 
			
		|||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						notes: notes,
 | 
			
		||||
						cursor: null
 | 
			
		||||
						more: false
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ export default Vue.extend({
 | 
			
		|||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						notes: notes,
 | 
			
		||||
						cursor: null
 | 
			
		||||
						more: false
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue