From a85524bc3d00d23f3e0eb84b1633cf344aa75e9c Mon Sep 17 00:00:00 2001 From: nanguage Date: Tue, 16 Apr 2024 17:45:45 +0200 Subject: [PATCH] fix bug in setServerSetting --- src/components/RunPanel.vue | 12 ++++++------ src/main.js | 5 +---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/RunPanel.vue b/src/components/RunPanel.vue index 94b8f48..cc205e8 100644 --- a/src/components/RunPanel.vue +++ b/src/components/RunPanel.vue @@ -343,20 +343,20 @@ export default { viewerControl: new ImagejJsController(this.ij), }); this.setInfoPanel(""); + this.turnButtons(true); if (window.app.client) { const clientApi = window.app.client; const urlParams = new URLSearchParams(window.location.search); if (urlParams.has("model")) { - const model = urlParams.get("model"); - await clientApi.setModel(model); + const model = urlParams.get("model"); + await clientApi.setModel(model); } if (urlParams.has("server_url") && urlParams.has("triton_service_id")) { - const serverUrl = urlParams.get("server_url"); - const serviceId = urlParams.get("triton_service_id"); - await clientApi.setServerSetting(serverUrl, serviceId); + const serverUrl = urlParams.get("server_url"); + const serviceId = urlParams.get("triton_service_id"); + await clientApi.setServerSetting(serverUrl, serviceId); } } - this.turnButtons(true); }, async initImJoy() { function waitForImjoy(timeout = 10000) { diff --git a/src/main.js b/src/main.js index 22c1c49..b75a7a6 100644 --- a/src/main.js +++ b/src/main.js @@ -170,13 +170,10 @@ async function createImjoyApi(api) { const serverStore = window.app.store.server; const runStore = window.app.store.run; runStore.$patch({ serverInitialized: false }); - if ((serverStore.serverUrl === serverUrl) && (serverStore.serviceId === serviceId)) { - runStore.$patch({ serverInitialized: true }); - return; - } serverStore.$patch({ serverUrl: serverUrl, serviceId: serviceId, + updateCount: serverStore.updateCount + 1, }); await waitState(() => runStore.serverInitialized, true); }