Skip to content

Commit b79fa89

Browse files
authored
Fix 404 after refreshing just saved new page (#182)
1 parent 3be01c1 commit b79fa89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/EditorPage.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {getNotebookById, createNotebook, addNotebook, saveNotebook, getNotebooks
77
import {isDirtyStore, countStore} from "./store.js";
88
import {cn} from "./cn.js";
99
import {SafeLink} from "./SafeLink.jsx";
10+
import {BASE_PATH} from "./shared.js";
1011

1112
const UNSET = Symbol("UNSET");
1213

@@ -39,7 +40,7 @@ export function EditorPage({id: initialId}) {
3940
prevCount.current = count;
4041
const id = notebook.id;
4142
setId(id); // Force re-render.
42-
window.history.pushState(null, "", `/works/${id}`); // Just update the url, no need to reload the page.
43+
window.history.pushState(null, "", `${BASE_PATH}/works/${id}`); // Just update the url, no need to reload the page.
4344
}
4445
// eslint-disable-next-line react-hooks/exhaustive-deps
4546
}, [notebook]);

0 commit comments

Comments
 (0)