mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-10 00:40:43 -07:00
fix: menubar usage
This commit is contained in:
parent
f2894047d2
commit
d365d964d8
2 changed files with 10 additions and 12 deletions
|
|
@ -355,7 +355,6 @@ export class Wiki implements IWikiService {
|
|||
// if is private repo wiki
|
||||
// if we are creating a sub-wiki just now, restart the main wiki to load content from private wiki
|
||||
if (typeof mainWikiToLink === 'string' && !this.justStartedWiki[mainWikiToLink]) {
|
||||
// TODO: change getByName to getByMainWikiPath, get by mainWikiPath
|
||||
const mainWorkspace = await this.workspaceService.getByWikiFolderLocation(mainWikiToLink);
|
||||
if (mainWorkspace === undefined) {
|
||||
throw new Error(`mainWorkspace is undefined in wikiStartup() for mainWikiPath ${mainWikiToLink}`);
|
||||
|
|
|
|||
|
|
@ -106,18 +106,15 @@ export class Window implements IWindowService {
|
|||
const attachToMenubar: boolean = await this.preferenceService.get('attachToMenubar');
|
||||
const titleBar: boolean = await this.preferenceService.get('titleBar');
|
||||
|
||||
// handle existed window, bring existed window to the front and return.
|
||||
if (existedWindow !== undefined) {
|
||||
// TODO: handle this menubar logic
|
||||
if (attachToMenubar) {
|
||||
if (this.mainWindowMenuBar !== undefined) {
|
||||
this.mainWindowMenuBar.on('ready', () => {
|
||||
if (this.mainWindowMenuBar !== undefined) {
|
||||
void this.mainWindowMenuBar.showWindow();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// create window with menubar
|
||||
}
|
||||
if (attachToMenubar && this.mainWindowMenuBar !== undefined) {
|
||||
this.mainWindowMenuBar.on('ready', () => {
|
||||
if (this.mainWindowMenuBar !== undefined) {
|
||||
void this.mainWindowMenuBar.showWindow();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (recreate === true || (typeof recreate === 'function' && existedWindowMeta !== undefined && recreate(existedWindowMeta))) {
|
||||
existedWindow.close();
|
||||
|
|
@ -126,12 +123,14 @@ export class Window implements IWindowService {
|
|||
}
|
||||
}
|
||||
|
||||
// create new window
|
||||
let mainWindowConfig: Partial<BrowserWindowConstructorOptions> = {};
|
||||
let mainWindowState: windowStateKeeperState | undefined;
|
||||
const isMainWindow = windowName === WindowNames.main;
|
||||
if (isMainWindow) {
|
||||
if (attachToMenubar) {
|
||||
this.mainWindowMenuBar = await handleAttachToMenuBar();
|
||||
return;
|
||||
}
|
||||
|
||||
mainWindowState = windowStateKeeper({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue