summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/components/post-form.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/desktop/views/components/post-form.vue')
-rw-r--r--src/client/app/desktop/views/components/post-form.vue5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index 5efa1eacca..aaec36ed37 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -382,9 +382,8 @@ export default Vue.extend({
if (this.text && this.text != '') {
const hashtags = parse(this.text).filter(x => x.type == 'hashtag').map(x => x.hashtag);
- let history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
- history = history.filter(x => !hashtags.includes(x));
- localStorage.setItem('hashtags', JSON.stringify(hashtags.concat(history)));
+ const history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
+ localStorage.setItem('hashtags', JSON.stringify(hashtags.concat(history).reduce((a, c) => a.includes(c) ? a : [...a, c], [])));
}
},