Browse Source

fix: Fixed plugin issue

pull/6539/head
Muhammed Mustafa 1 year ago
parent
commit
ed76a12855
  1. 8
      packages/nc-gui/plugins/tele.ts

8
packages/nc-gui/plugins/tele.ts

@ -84,8 +84,12 @@ export default defineNuxtPlugin(async (nuxtApp) => {
}
watch((nuxtApp.$state as ReturnType<typeof useGlobal>).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)

Loading…
Cancel
Save