fix: do this in view window

This commit is contained in:
lin onetwo 2022-11-23 18:05:40 +08:00
parent cdd1b8471b
commit bbe2465cff
2 changed files with 5 additions and 3 deletions

View file

@ -8,7 +8,7 @@ import './common/log';
import './common/remote';
import * as service from './common/services';
import { ViewChannel } from '@/constants/channels';
import { IPossibleWindowMeta } from '@services/windows/WindowProperties';
import { IPossibleWindowMeta, WindowNames } from '@services/windows/WindowProperties';
import { browserViewMetaData } from './common/browserViewMetaData';
import './common/authingPostMessage';
import './view';
@ -24,9 +24,9 @@ declare global {
}
}
if (browserViewMetaData.windowName === 'main') {
if (browserViewMetaData.windowName === WindowNames.view) {
// automatically reload page when wifi/network is connected
// https://www.electronjs.org/docs/tutorial/online-offline-events
// https://www.electronjs.org/docs/latest/tutorial/online-offline-events
const handleOnlineOffline = (): void => {
void ipcRenderer.invoke(ViewChannel.onlineStatusChanged, window.navigator.onLine);
};

View file

@ -5,12 +5,14 @@ export enum WindowNames {
addWorkspace = 'addWorkspace',
auth = 'auth',
editWorkspace = 'editWorkspace',
/** Window with workspace list and new wiki button on left side bar */
main = 'main',
menuBar = 'menuBar',
newWindow = 'newWindow',
notifications = 'notifications',
preferences = 'preferences',
spellcheck = 'spellcheck',
/** browserView that loads the wiki webpage */
view = 'view',
}