mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-03 04:21:05 -08:00
feat: menu item to open new window
This commit is contained in:
parent
300ae255eb
commit
0156e80bbd
3 changed files with 11 additions and 1 deletions
|
|
@ -36,6 +36,7 @@ interface IWorkspaceMenuRequiredServices {
|
|||
| 'restartWorkspaceViewService'
|
||||
| 'realignActiveWorkspace'
|
||||
| 'openUrlInWorkspace'
|
||||
| 'openWorkspaceWindowWithView'
|
||||
>;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +68,7 @@ export async function getWorkspaceMenuTemplate(
|
|||
t: TFunction<[_DefaultNamespace, ...Array<Exclude<FlatNamespace, _DefaultNamespace>>]>,
|
||||
service: IWorkspaceMenuRequiredServices,
|
||||
): Promise<MenuItemConstructorOptions[]> {
|
||||
const { active, id, mainWikiID, hibernated, tagName, isSubWiki, wikiFolderLocation, gitUrl, storageService, port, name, enableHTTPAPI } = workspace;
|
||||
const { active, id, mainWikiID, hibernated, tagName, isSubWiki, wikiFolderLocation, gitUrl, storageService, port, name, enableHTTPAPI, lastUrl, homeUrl } = workspace;
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
const template: MenuItemConstructorOptions[] = [
|
||||
{
|
||||
|
|
@ -78,6 +79,13 @@ export async function getWorkspaceMenuTemplate(
|
|||
await openWorkspaceTagTiddler(workspace, service);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('ContextMenu.OpenWorkspaceInNewWindow'),
|
||||
enabled: !hibernated,
|
||||
click: async () => {
|
||||
await service.workspaceView.openWorkspaceWindowWithView(workspace, { uri: lastUrl ?? homeUrl });
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('WorkspaceSelector.EditWorkspace'),
|
||||
click: async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue