1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-28 06:48:42 +09:00

fix(client): 投稿フォームのハッシュタグ保持フィールドが動作しない問題を修正

Fix #8212
This commit is contained in:
syuilo 2022-01-29 02:54:56 +09:00
parent a222e3d054
commit f0e720931b
2 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@
- トレンドウィジェットが動作しないのを修正
- リアクション設定で絵文字ピッカーが開かないのを修正
- DMページでメンションが含まれる問題を修正
- 投稿フォームのハッシュタグ保持フィールドが動作しない問題を修正
- Add `img-src` and `media-src` directives to `Content-Security-Policy` for
files and media proxy

View File

@ -540,8 +540,8 @@ async function post() {
};
if (withHashtags && hashtags && hashtags.trim() !== '') {
const hashtags = hashtags.trim().split(' ').map(x => x.startsWith('#') ? x : '#' + x).join(' ');
data.text = data.text ? `${data.text} ${hashtags}` : hashtags;
const hashtags_ = hashtags.trim().split(' ').map(x => x.startsWith('#') ? x : '#' + x).join(' ');
data.text = data.text ? `${data.text} ${hashtags_}` : hashtags_;
}
// plugin
@ -565,9 +565,9 @@ async function post() {
deleteDraft();
emit('posted');
if (data.text && data.text != '') {
const hashtags = mfm.parse(data.text).filter(x => x.type === 'hashtag').map(x => x.props.hashtag);
const hashtags_ = mfm.parse(data.text).filter(x => x.type === 'hashtag').map(x => x.props.hashtag);
const history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
localStorage.setItem('hashtags', JSON.stringify(unique(hashtags.concat(history))));
localStorage.setItem('hashtags', JSON.stringify(unique(hashtags_.concat(history))));
}
posting = false;
postAccount = null;