Browse Source

feat(gui-v2): add refs for running requests and error to global

pull/2877/head
braks 2 years ago
parent
commit
816d8c50b9
  1. 8
      packages/nc-gui-v2/composables/useGlobal/state.ts
  2. 2
      packages/nc-gui-v2/composables/useGlobal/types.ts

8
packages/nc-gui-v2/composables/useGlobal/state.ts

@ -71,6 +71,12 @@ export function useGlobalState(): State {
/** global loading state */
const isLoading = ref(false)
/** currently running requests */
const runningRequests = ref<number[]>([])
/** global error */
const error = ref()
return {
...toRefs(storage.value),
token,
@ -78,5 +84,7 @@ export function useGlobalState(): State {
sidebarOpen,
timestamp,
isLoading,
runningRequests,
error,
}
}

2
packages/nc-gui-v2/composables/useGlobal/types.ts

@ -16,6 +16,8 @@ export type State = ToRefs<Omit<StoredState, 'token'>> & {
sidebarOpen: Ref<boolean>
timestamp: Ref<number>
isLoading: Ref<boolean>
runningRequests: Ref<number[]>
error: Ref<any>
}
export interface Getters {

Loading…
Cancel
Save