mirror of
https://github.com/unraid/api.git
synced 2026-02-22 08:18:39 -06:00
fix: trigger loading correctly
This commit is contained in:
@@ -15,10 +15,7 @@ import { createClient } from "graphql-ws";
|
||||
import { WEBGUI_GRAPHQL } from "./urls";
|
||||
import { createApolloCache } from "./apollo-cache";
|
||||
import { ApolloLink, Observable } from "@apollo/client/core";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { useServerStore } from "~/store/server";
|
||||
import { connect } from "http2";
|
||||
|
||||
const httpEndpoint = WEBGUI_GRAPHQL;
|
||||
const wsEndpoint = new URL(WEBGUI_GRAPHQL.toString().replace("http", "ws"));
|
||||
@@ -88,8 +85,8 @@ const retryLink = new RetryLink({
|
||||
const disableClientLink = new ApolloLink((operation, forward) => {
|
||||
const serverStore = useServerStore();
|
||||
const { connectPluginInstalled, guid} = toRefs(serverStore);
|
||||
console.log("serverStore.connectPluginInstalled", connectPluginInstalled.value, guid.value);
|
||||
if (!connectPluginInstalled.value) {
|
||||
console.log("serverStore.connectPluginInstalled", connectPluginInstalled?.value, guid?.value);
|
||||
if (!connectPluginInstalled?.value) {
|
||||
return new Observable((observer) => {
|
||||
console.warn("connectPluginInstalled is false, aborting request");
|
||||
observer.complete();
|
||||
|
||||
1303
web/store/server.ts
1303
web/store/server.ts
File diff suppressed because it is too large
Load Diff
@@ -26,20 +26,6 @@ export const useUnraidApiStore = defineStore("unraidApi", () => {
|
||||
client
|
||||
);
|
||||
|
||||
watch(
|
||||
serverStore,
|
||||
async (newVal) => {
|
||||
if (!newVal.fetchServerFromApi) {
|
||||
return;
|
||||
}
|
||||
const apiResponse = await newVal.fetchServerFromApi();
|
||||
if (apiResponse) {
|
||||
// we have a response, so we're online
|
||||
unraidApiStatus.value = "online";
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// const unraidApiErrors = ref<any[]>([]);
|
||||
const unraidApiStatus = ref<
|
||||
"connecting" | "offline" | "online" | "restarting"
|
||||
|
||||
Reference in New Issue
Block a user