mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 01:30:23 +01:00
fix(frontend): デッキでダブルクリックするとウィンドウが2枚開く問題を修正
This commit is contained in:
parent
dac3b1f405
commit
6df65d4bdd
1 changed files with 8 additions and 0 deletions
|
@ -135,11 +135,19 @@ const columnComponents = {
|
||||||
roleTimeline: XRoleTimelineColumn,
|
roleTimeline: XRoleTimelineColumn,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ダブルクリック時には2回クリックされた扱いになるので、2回目抑止するためのタイマー
|
||||||
|
// これによりウィンドウが2枚開かれることを防ぐ
|
||||||
|
let routerNavTimer: number | null = null;
|
||||||
|
|
||||||
mainRouter.navHook = (path, flag): boolean => {
|
mainRouter.navHook = (path, flag): boolean => {
|
||||||
if (flag === 'forcePage') return false;
|
if (flag === 'forcePage') return false;
|
||||||
|
if (routerNavTimer != null) return true;
|
||||||
const noMainColumn = !deckStore.state.columns.some(x => x.type === 'main');
|
const noMainColumn = !deckStore.state.columns.some(x => x.type === 'main');
|
||||||
if (deckStore.state.navWindow || noMainColumn) {
|
if (deckStore.state.navWindow || noMainColumn) {
|
||||||
os.pageWindow(path);
|
os.pageWindow(path);
|
||||||
|
routerNavTimer = setTimeout(() => {
|
||||||
|
routerNavTimer = null;
|
||||||
|
}, 500);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue