-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): 設定変更時のリロード確認ダイアログが複数個表示されることがある問題を修正 (#14543)
* fix(frontend): reloadAskが同時に複数実行されないように * Update Changelog * fix * フラグ解除が確実に行われるように * reloadAskを汎用化、理由を受け取るように * fix
- Loading branch information
1 parent
ce95323
commit 3bf63dd
Showing
8 changed files
with
53 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { i18n } from '@/i18n.js'; | ||
import * as os from '@/os.js'; | ||
import { unisonReload } from '@/scripts/unison-reload.js'; | ||
|
||
let isReloadConfirming = false; | ||
|
||
export async function reloadAsk(opts: { | ||
unison?: boolean; | ||
reason?: string; | ||
}) { | ||
if (isReloadConfirming) { | ||
return; | ||
} | ||
|
||
isReloadConfirming = true; | ||
|
||
const { canceled } = await os.confirm(opts.reason == null ? { | ||
type: 'info', | ||
text: i18n.ts.reloadConfirm, | ||
} : { | ||
type: 'info', | ||
title: i18n.ts.reloadConfirm, | ||
text: opts.reason, | ||
}).finally(() => { | ||
isReloadConfirming = false; | ||
}); | ||
|
||
if (canceled) return; | ||
|
||
if (opts.unison) { | ||
unisonReload(); | ||
} else { | ||
location.reload(); | ||
} | ||
} |
3bf63dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chromatic detects changes. Please review the changes on Chromatic.