add a refocus at the end of wave reinit (#1499)

This commit is contained in:
Mike Sawka 2024-12-11 13:13:40 -08:00 committed by GitHub
parent 4918737044
commit f4de338bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -142,6 +142,10 @@ function switchTab(offset: number) {
}
function handleCmdI() {
globalRefocus();
}
function globalRefocus() {
const layoutModel = getLayoutModelForStaticTab();
const focusedNode = globalStore.get(layoutModel.focusedNode);
if (focusedNode == null) {
@ -345,6 +349,7 @@ export {
appHandleKeyDown,
getAllGlobalKeyBindings,
getSimpleControlShiftAtom,
globalRefocus,
registerControlShiftStateUpdateHandler,
registerElectronReinjectKeyHandler,
registerGlobalKeys,

View File

@ -3,6 +3,7 @@
import { App } from "@/app/app";
import {
globalRefocus,
registerControlShiftStateUpdateHandler,
registerElectronReinjectKeyHandler,
registerGlobalKeys,
@ -106,6 +107,9 @@ async function reinitWave() {
getApi().setWindowInitStatus("wave-ready");
globalStore.set(atoms.reinitVersion, globalStore.get(atoms.reinitVersion) + 1);
globalStore.set(atoms.updaterStatusAtom, getApi().getUpdaterStatus());
setTimeout(() => {
globalRefocus();
}, 50);
}
function reloadAllWorkspaceTabs(ws: Workspace) {