mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
Fix bug where helpview fails to load sub-pages after idle (#1056)
closes #1048
This commit is contained in:
parent
a5999aa02a
commit
f77b42d70c
@ -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 New Issue
Block a user