Fix going back returning a blank screen

This commit is contained in:
KingRainbow44 2023-05-12 23:40:29 -04:00
parent 5f9d5dd33f
commit 10adc756d7
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -57,6 +57,10 @@ export function removeNavListener(listener: (page: Page) => void) {
* @param update Whether to update the state or not.
*/
export function navigate(page: Page, update: boolean = true): Page | null {
// Check the page.
if (page == undefined)
page = "Home";
// Navigate to the new page.
const lastPage = currentPage;
navigation.emit("navigate", page);