From d0819b8d02cb943316d682f092b8857ca1b980c8 Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Mon, 13 Jan 2025 12:13:41 -0500 Subject: [PATCH] fix(web): flash of disconnected api state on page load Changes initial unraidApiStatus to connecting instead of offline. This prevents a flash of the offline state on page loads and navigation. --- web/store/unraidApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/store/unraidApi.ts b/web/store/unraidApi.ts index 7d486faa3..828da8ef5 100644 --- a/web/store/unraidApi.ts +++ b/web/store/unraidApi.ts @@ -1,4 +1,4 @@ -import { type ApolloClient as ApolloClientType, type NormalizedCacheObject } from '@apollo/client'; +import type { ApolloClient as ApolloClientType, NormalizedCacheObject } from '@apollo/client'; import { ArrowPathIcon } from '@heroicons/vue/24/solid'; import { WebguiUnraidApiCommand } from '~/composables/services/webgui'; import { client } from '~/helpers/create-apollo-client'; @@ -20,7 +20,7 @@ export const useUnraidApiStore = defineStore('unraidApi', () => { const unraidApiClient = ref | null>(client); // const unraidApiErrors = ref([]); - const unraidApiStatus = ref<'connecting' | 'offline' | 'online' | 'restarting'>('offline'); + const unraidApiStatus = ref<'connecting' | 'offline' | 'online' | 'restarting'>('connecting'); const prioritizeCorsError = ref(false); // Ensures we don't overwrite this specific error message with a non-descriptive network error message const offlineError = computed(() => {