Skip to content

Commit

Permalink
Force re-render of console and file on nav
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Dec 20, 2024
1 parent f2f291a commit 5b3817a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pages/dashboard/[server]/console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const Console = ({
}

const ConsolePage = (): React.JSX.Element => {
const { server, nodeExists } = useOctyneData()
const { server, node, nodeExists } = useOctyneData()
const [serverExists, setServerExists] = useState(true)
const [authenticated, setAuthenticated] = useState(true)
return (
Expand All @@ -284,7 +284,11 @@ const ConsolePage = (): React.JSX.Element => {
) : !authenticated ? (
<AuthFailure />
) : (
<Console setAuthenticated={setAuthenticated} setServerExists={setServerExists} />
<Console
key={JSON.stringify({ server, node })}
setAuthenticated={setAuthenticated}
setServerExists={setServerExists}
/>
)}
</DashboardLayout>
</React.StrictMode>
Expand Down
8 changes: 6 additions & 2 deletions pages/dashboard/[server]/files/[[...path]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import DashboardLayout from '../../../../imports/dashboard/dashboardLayout'
import FileManager from '../../../../imports/dashboard/files/fileManager'

const Files: NextPage<Record<string, unknown>> = () => {
const { nodeExists } = useOctyneData()
const { server, node, nodeExists } = useOctyneData()
const [serverExists, setServerExists] = useState(true)
const [authenticated, setAuthenticated] = useState(true)

Expand All @@ -20,7 +20,11 @@ const Files: NextPage<Record<string, unknown>> = () => {
) : !authenticated ? (
<AuthFailure />
) : (
<FileManager setServerExists={setServerExists} setAuthenticated={setAuthenticated} />
<FileManager
key={JSON.stringify({ server, node })}
setServerExists={setServerExists}
setAuthenticated={setAuthenticated}
/>
)}
</DashboardLayout>
</React.StrictMode>
Expand Down

0 comments on commit 5b3817a

Please sign in to comment.