mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
タグサジェストが重複しないようにする
This commit is contained in:
parent
df160daf75
commit
f75ec78291
2 changed files with 4 additions and 6 deletions
|
@ -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], [])));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -295,9 +295,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], [])));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue