diff --git a/resources/scripts/components/server/ServerConsole.tsx b/resources/scripts/components/server/ServerConsole.tsx
index 0d0c5ee61..a746e4556 100644
--- a/resources/scripts/components/server/ServerConsole.tsx
+++ b/resources/scripts/components/server/ServerConsole.tsx
@@ -73,7 +73,7 @@ export default () => {
return () => {
instance.removeListener('stats', statsListener);
};
- }, [ connected ]);
+ }, [ instance, connected ]);
return (
@@ -135,7 +135,7 @@ export default () => {
- {status !== 'offline' && }
+
diff --git a/resources/scripts/components/server/StatGraphs.tsx b/resources/scripts/components/server/StatGraphs.tsx
index 92e920e3c..7de8a4d13 100644
--- a/resources/scripts/components/server/StatGraphs.tsx
+++ b/resources/scripts/components/server/StatGraphs.tsx
@@ -72,7 +72,8 @@ const createDefaultChart = (ctx: CanvasRenderingContext2D, options?: ChartConfig
});
export default () => {
- const { limits } = ServerContext.useStoreState(state => state.server.data!);
+ const status = ServerContext.useStoreState(state => state.status.value);
+ const limits = ServerContext.useStoreState(state => state.server.data!.limits);
const { connected, instance } = ServerContext.useStoreState(state => state.socket);
const [ memory, setMemory ] = useState();
@@ -152,15 +153,28 @@ export default () => {
return () => {
instance.removeListener('stats', statsListener);
};
- }, [ connected, memory, cpu ]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [ instance, connected, memory, cpu ]);
return (
-
-
+ {status !== 'offline' ?
+
+ :
+
+ Server is offline.
+
+ }
);