mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 08:48:28 +00:00
Fix bug where helpview fails to load sub-pages after idle (#1056)
closes #1048
This commit is contained in:
parent
a5999aa02a
commit
f77b42d70c
1 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
}),
|
||||
[]
|
||||
|
|
|
|||
Loading…
Reference in a new issue