Web: Allow navigating to a page on launch with URL argument
This commit is contained in:
parent
ebe76f23c0
commit
e49e841543
@ -204,6 +204,28 @@ if (getStorage("analytics") !== "false") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.title = SETTINGS.branding.apptitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the page set in the startpage URL parameter.
|
||||||
|
* @returns {Boolean} true if navigated to a set page, false if app should open something else.
|
||||||
|
*/
|
||||||
|
function openStartpageURLArg() {
|
||||||
|
try {
|
||||||
|
var urlParams = new URLSearchParams(window.location.search);
|
||||||
|
if (urlParams.has("startpage")) {
|
||||||
|
var startpage = urlParams.get("startpage");
|
||||||
|
if (startpage == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
router.navigate("/" + startpage);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (setup) {
|
if (setup) {
|
||||||
router.navigate("/home");
|
router.navigate("/home");
|
||||||
} else {
|
} else {
|
||||||
@ -212,4 +234,5 @@ if (setup) {
|
|||||||
pushState: false
|
pushState: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
document.title = SETTINGS.branding.apptitle;
|
|
||||||
|
openStartpageURLArg();
|
Loading…
x
Reference in New Issue
Block a user