Added support for hash routing in URL shown in address bar.

This commit is contained in:
CalDescent 2023-04-09 18:21:19 +01:00
parent ce52b39495
commit 7f53983d77

View File

@ -389,13 +389,14 @@ document.addEventListener('DOMContentLoaded', () => {
* Handle app navigation
*/
navigation.addEventListener('navigate', (event) => {
let pathname = new URL(event.destination.url).pathname;
const url = new URL(event.destination.url);
let fullpath = url.pathname + url.hash;
qortalRequest({
action: "QDN_RESOURCE_DISPLAYED",
service: _qdnService,
name: _qdnName,
identifier: _qdnIdentifier,
path: (pathname.startsWith(_qdnBase)) ? pathname.slice(_qdnBase.length) : pathname
path: (fullpath.startsWith(_qdnBase)) ? fullpath.slice(_qdnBase.length) : fullpath
});
});