Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): デッキでダブルクリックするとウィンドウが2枚開く問題を修正 #15105

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Fix: 公開範囲がホームのノートの埋め込みウィジェットが読み込まれない問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/803)
- Fix: 絵文字管理画面で一部の絵文字が表示されない問題を修正
- Fix: デッキでリンクをダブルクリックすると、ウィンドウが2枚開いてしまう問題を修正

### Server
- Fix: ユーザーのプロフィール画面をアドレス入力などで直接表示した際に概要タブの描画に失敗する問題の修正( #15032 )
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/src/ui/deck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,19 @@ const columnComponents = {
roleTimeline: XRoleTimelineColumn,
};

// ダブルクリック時には2回クリックされた扱いになるので、2回目抑止するためのタイマー
// これによりウィンドウが2枚開かれることを防ぐ
let routerNavTimer: number | null = null;

mainRouter.navHook = (path, flag): boolean => {
if (flag === 'forcePage') return false;
if (routerNavTimer != null) return true;
const noMainColumn = !deckStore.state.columns.some(x => x.type === 'main');
if (deckStore.state.navWindow || noMainColumn) {
os.pageWindow(path);
routerNavTimer = setTimeout(() => {
routerNavTimer = null;
}, 300);
return true;
}
return false;
Expand Down
Loading