Skip to content

Commit

Permalink
Fix bug where helpview fails to load sub-pages after idle
Browse files Browse the repository at this point in the history
  • Loading branch information
esimkowitz committed Oct 17, 2024
1 parent fae0660 commit e361af5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/app/view/helpview/helpview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ function makeHelpViewModel(blockId: string, nodeModel: NodeModel) {

function HelpView({ model }: { model: HelpViewModel }) {
const homepageUrl = useAtomValue(model.homepageUrl);
const url = useAtomValue(model.url);

// Effect to update the docsite base url when the app restarts, since the webserver port is dynamic
useEffect(
() =>
fireAndForget(async () => {
const curDocsiteUrl = getApi().getDocsiteUrl();
if (curDocsiteUrl !== homepageUrl) {
await model.setHomepageUrl(curDocsiteUrl, "block");
model.loadUrl(url.replace(homepageUrl, curDocsiteUrl), "new-base-url");
}
}),
[]
Expand Down

0 comments on commit e361af5

Please sign in to comment.