fix leave server selected after opening once
This commit is contained in:
parent
44a9e2aeb0
commit
da6b5b9f60
@ -4,7 +4,7 @@ import { createAndShowNotification } from "./notification";
|
||||
import { Server } from "./preload-local-app/types";
|
||||
import settings, { SettingsData } from "./settings";
|
||||
import { loadShortcuts, setShortcutsEnabled } from "./shortcuts";
|
||||
import { getAppView, getWindow, hideAppView, showAppView } from "./window";
|
||||
import { getAppView, hideAppView, showAppView } from "./window";
|
||||
// import fetch from "node-fetch";
|
||||
|
||||
export function emitMuteToggle() {
|
||||
|
@ -6,8 +6,9 @@ import { loadCustomScheme } from "./serve";
|
||||
|
||||
let mainWindow: BrowserWindow | undefined;
|
||||
let appView: BrowserView | undefined;
|
||||
let appViewUrl = "";
|
||||
|
||||
const sidebarWidth = 75;
|
||||
const sidebarWidth = 80;
|
||||
|
||||
export function getWindow() {
|
||||
return mainWindow;
|
||||
@ -128,8 +129,9 @@ export function showAppView(url?: string) {
|
||||
}
|
||||
mainWindow.addBrowserView(appView);
|
||||
|
||||
if (url) {
|
||||
if (url && url !== appViewUrl) {
|
||||
appView.webContents.loadURL(url);
|
||||
appViewUrl = url;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { onDestroy, onMount } from "svelte";
|
||||
import { useParams } from "svelte-navigator";
|
||||
|
||||
import { selectServer, servers, selectedServer } from "~/store";
|
||||
import { selectServer, servers } from "~/store";
|
||||
import { api } from "~/lib/ipc";
|
||||
|
||||
const params = useParams();
|
||||
@ -11,13 +11,8 @@
|
||||
selectServer(_params.id);
|
||||
});
|
||||
|
||||
onMount(async () => {
|
||||
await selectServer($params.id);
|
||||
});
|
||||
|
||||
onDestroy(async () => {
|
||||
await api.showLocalApp();
|
||||
$selectedServer = "";
|
||||
});
|
||||
|
||||
$: server = $servers.find(({ _id }) => _id === $params.id);
|
||||
|
Loading…
Reference in New Issue
Block a user