disconnect command

This commit is contained in:
Jan Prochazka
2022-12-25 19:27:24 +01:00
parent 5c1c4e1fa6
commit c340ac9112
5 changed files with 23 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ import { openWebLink } from '../utility/exportFileTools';
import { getSettings } from '../utility/metadataLoaders';
import { isMac } from '../utility/common';
import { doLogout, internalRedirectTo } from '../clientAuth';
import { disconnectServerConnection } from '../appobj/ConnectionAppObject.svelte';
// function themeCommand(theme: ThemeDefinition) {
// return {
@@ -552,6 +553,14 @@ registerCommand({
onClick: doLogout,
});
registerCommand({
id: 'app.disconnect',
category: 'App',
name: 'Disconnect',
testEnabled: () => getCurrentConfig()?.singleConnection != null,
onClick: () => disconnectServerConnection(getCurrentConfig()?.singleConnection?._id),
});
export function registerFileCommands({
idPrefix,
category,