From ed76a128556dfbe4f118cc9c56f1d50c1fa631b4 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 2 Oct 2023 11:43:03 +0000 Subject: [PATCH] fix: Fixed plugin issue --- packages/nc-gui/plugins/tele.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/plugins/tele.ts b/packages/nc-gui/plugins/tele.ts index 5e635629e9..0f9c82dc2e 100644 --- a/packages/nc-gui/plugins/tele.ts +++ b/packages/nc-gui/plugins/tele.ts @@ -84,8 +84,12 @@ export default defineNuxtPlugin(async (nuxtApp) => { } watch((nuxtApp.$state as ReturnType).token, (newToken, oldToken) => { - if (newToken && newToken !== oldToken) init(newToken) - else if (!newToken) socket.disconnect() + try { + if (newToken && newToken !== oldToken) init(newToken) + else if (!newToken) socket?.disconnect() + } catch (e) { + console.error(e) + } }) nuxtApp.provide('tele', tele)