mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48: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 }) {
|
function HelpView({ model }: { model: HelpViewModel }) {
|
||||||
const homepageUrl = useAtomValue(model.homepageUrl);
|
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(
|
useEffect(
|
||||||
() =>
|
() =>
|
||||||
fireAndForget(async () => {
|
fireAndForget(async () => {
|
||||||
const curDocsiteUrl = getApi().getDocsiteUrl();
|
const curDocsiteUrl = getApi().getDocsiteUrl();
|
||||||
if (curDocsiteUrl !== homepageUrl) {
|
if (curDocsiteUrl !== homepageUrl) {
|
||||||
await model.setHomepageUrl(curDocsiteUrl, "block");
|
await model.setHomepageUrl(curDocsiteUrl, "block");
|
||||||
|
model.loadUrl(url.replace(homepageUrl, curDocsiteUrl), "new-base-url");
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
[]
|
[]
|
||||||
|
Loading…
Reference in New Issue
Block a user