Skip to content

Commit

Permalink
fix: After opening menuba, preference window close automatically as s…
Browse files Browse the repository at this point in the history
…oon as you type

fixes #137

This logic's properse is unknown,but I think I should delete it.
  • Loading branch information
linonetwo committed Feb 2, 2022
1 parent bcbd761 commit 11be8cb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ function App(): JSX.Element {

async function runApp(): Promise<void> {
void window.remote.setVisualZoomLevelLimits(1, 1);

const attachToMenubar = await window.service.preference.get('attachToMenubar');
if (window.meta.windowName !== WindowNames.main && attachToMenubar) {
document.addEventListener('keydown', (_event) => {
void (async () => {
const { preventClosingWindow } = (await window.service.window.getWindowMeta(WindowNames.preferences)) as IPreferenceWindowMeta;
if (window?.meta?.windowName === WindowNames.preferences && preventClosingWindow) {
return;
}
void window?.remote?.closeCurrentWindow?.();
})();
});
}

ReactDOM.render(<App />, document.querySelector('#app'));

await initI18N();
Expand Down

0 comments on commit 11be8cb

Please sign in to comment.