Browse Source

refactor: review comments

pull/9784/head
Pranav C 1 week ago
parent
commit
118731d5e4
  1. 3
      packages/nc-gui/composables/useGlobal/actions.ts
  2. 3
      packages/nc-gui/store/notification.ts

3
packages/nc-gui/composables/useGlobal/actions.ts

@ -73,8 +73,6 @@ export function useGlobalActions(state: State, getters: Getters): Actions {
const nuxtApp = useNuxtApp()
const t = nuxtApp.vueApp.i18n.global.t
isTokenRefreshInProgress.value = true
if (!axiosInstance) {
axiosInstance = nuxtApp.$api?.instance
}
@ -101,6 +99,7 @@ export function useGlobalActions(state: State, getters: Getters): Actions {
const refreshToken = useSharedExecutionFn('refreshToken', _refreshToken, {
timeout: 10000,
storageDelay: 1000
})
const loadAppInfo = async () => {

3
packages/nc-gui/store/notification.ts

@ -6,8 +6,6 @@ import { useStorage } from '@vueuse/core'
const CancelToken = axios.CancelToken
export const useNotification = defineStore('notificationStore', () => {
const isTokenRefreshInProgress = useStorage(TOKEN_REFRESH_PROGRESS_KEY, false)
const readNotifications = ref<NotificationType[]>([])
const unreadNotifications = ref<NotificationType[]>([])
@ -195,7 +193,6 @@ export const useNotification = defineStore('notificationStore', () => {
cancelTokenSource = null
// wait if refresh token generation is in progress and cancel the polling after that
// set a timeout of 10 seconds to avoid hanging
await until(isTokenRefreshInProgress).toMatch((v) => !v, { timeout: 10000 })
source?.cancel()
}

Loading…
Cancel
Save