Skip to content

Commit

Permalink
fix: use lastMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 20, 2024
1 parent 8248d11 commit 249b699
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/ServerDetailChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type connectChartData = {
export default function ServerDetailChart({ server_id }: { server_id: string }) {
const { lastMessage, connected } = useWebSocketContext()

if (!connected) {
if (!connected || !lastMessage) {
return <ServerDetailChartLoading />
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ServerDetailOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function ServerDetailOverview({ server_id }: { server_id: string

const { lastMessage, connected } = useWebSocketContext()

if (!connected) {
if (!connected || !lastMessage) {
return <ServerDetailLoading />
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function Servers() {
}
}, [connected])

if (!connected) {
if (!connected && !lastMessage) {
return (
<div className="flex flex-col items-center min-h-96 justify-center ">
<div className="font-semibold flex items-center gap-2 text-sm">
Expand Down

0 comments on commit 249b699

Please sign in to comment.