Skip to content

Commit

Permalink
fix: get rid of "Something went wrong..." during initial load
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Song <[email protected]>
  • Loading branch information
ferothefox committed Oct 18, 2024
1 parent fe541d9 commit a23d24f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/frontend/src/pages/servers/manage/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<div data-pyro-mount class="h-full w-full flex-1">
<div
v-if="!isConnected && !isReconnecting"
v-if="!isConnected && !isReconnecting && !isLoading"
data-pyro-server-ws-error
class="mb-4 flex w-full flex-row items-center gap-4 rounded-xl bg-bg-red p-4 text-contrast"
>
Expand Down Expand Up @@ -116,6 +116,7 @@ import type { ServerState, Stats, WSEvent, WSInstallationResultEvent } from "~/t
const socket = ref<WebSocket | null>(null);
const isReconnecting = ref(false);
const isLoading = ref(true); // initial loading state
const reconnectInterval = ref<ReturnType<typeof setInterval> | null>(null);
const route = useNativeRoute();
Expand Down Expand Up @@ -193,6 +194,7 @@ const connectWebSocket = () => {
socket.value?.send(JSON.stringify({ event: "auth", jwt: wsAuth.value?.token }));
isConnected.value = true;
isReconnecting.value = false;
isLoading.value = false;
if (reconnectInterval.value) {
clearInterval(reconnectInterval.value);
reconnectInterval.value = null;
Expand Down

0 comments on commit a23d24f

Please sign in to comment.