diff --git a/components/AbuseReports.vue b/components/AbuseReports.vue index b5e5daedd..35d5c1b1b 100644 --- a/components/AbuseReports.vue +++ b/components/AbuseReports.vue @@ -39,12 +39,20 @@ Case closed - - - I checked the profile, it's OK. - + this.canBeInQueue(r)).map(r => r.susUsername))]); + localStorage.setItem('moderationQueueCaret', report.susUsername); + this.$router.push('/@' + report.susUsername); + }, } }; diff --git a/components/Ban.vue b/components/Ban.vue index c92159fa5..7eb3df2c2 100644 --- a/components/Ban.vue +++ b/components/Ban.vue @@ -166,6 +166,22 @@ +
+ + +
@@ -223,7 +239,11 @@ To keep our platform safe and inclusive, please remove this content. Thanks! ` - } + }, + + moderationQueue: undefined, + moderationQueueCaret: undefined, + moderationQueueIndex: undefined, } }, async mounted() { @@ -238,6 +258,23 @@ Thanks! if (this.messages.length > 0) { this.showMessages = true; } + + if (!process.client) { return; } + this.moderationQueue = localStorage.getItem('moderationQueue'); + this.moderationQueueCaret = localStorage.getItem('moderationQueueCaret'); + + if (this.moderationQueue) { + this.moderationQueue = this.moderationQueue.split(',') + this.moderationQueueIndex = this.moderationQueue.indexOf(this.moderationQueueCaret); + if (this.moderationQueueIndex < 0) { + this.moderationQueue = undefined; + this.moderationQueueCaret = undefined; + this.moderationQueueIndex = undefined; + localStorage.removeItem('moderationQueue'); + localStorage.removeItem('moderationQueueCaret'); + return; + } + } }, methods: { async ban() { @@ -307,7 +344,17 @@ Thanks! }, nl2br(text) { return text.replace(new RegExp('\\n', 'g'), '
'); - } + }, + queuePrevious() { + this.moderationQueueCaret = this.moderationQueue[this.moderationQueueIndex - 1]; + localStorage.setItem('moderationQueueCaret', this.moderationQueueCaret); + this.$router.push('/@' + this.moderationQueueCaret); + }, + queueNext() { + this.moderationQueueCaret = this.moderationQueue[this.moderationQueueIndex + 1]; + localStorage.setItem('moderationQueueCaret', this.moderationQueueCaret); + this.$router.push('/@' + this.moderationQueueCaret); + }, }, computed: { canApplyBan() { diff --git a/routes/adminAbuseReports.vue b/routes/adminAbuseReports.vue index fba6b170a..55d0775c9 100644 --- a/routes/adminAbuseReports.vue +++ b/routes/adminAbuseReports.vue @@ -47,7 +47,7 @@ - +