URL hashes relative to the room of the archive

This commit is contained in:
Eric Eastwood 2022-06-07 19:41:08 -05:00
parent 1a0b1403ef
commit 5d9dc638ea
3 changed files with 3 additions and 4 deletions

View file

@ -36,7 +36,6 @@ export class URLRouter {
} }
attach() { attach() {
console.log('attach');
this._subscription = this._history.subscribe(url => this._applyUrl(url)); this._subscription = this._history.subscribe(url => this._applyUrl(url));
// subscribe to path before applying initial url // subscribe to path before applying initial url
// so redirects in _applyNavPathToHistory are reflected in url bar // so redirects in _applyNavPathToHistory are reflected in url bar
@ -76,7 +75,6 @@ export class URLRouter {
} }
_applyUrl(url) { _applyUrl(url) {
console.log('URLRouter _applyUrl', url);
const navPath = this._urlAsNavPath(url); const navPath = this._urlAsNavPath(url);
this._applyNavPathToNavigation(navPath); this._applyNavPathToNavigation(navPath);
} }

View file

@ -71,6 +71,7 @@ export {TextMessageView} from "./platform/web/ui/session/room/timeline/TextMessa
export {VideoView} from "./platform/web/ui/session/room/timeline/VideoView.js"; export {VideoView} from "./platform/web/ui/session/room/timeline/VideoView.js";
export {Navigation} from "./domain/navigation/Navigation.js"; export {Navigation} from "./domain/navigation/Navigation.js";
export {History} from "./platform/web/dom/History.js";
export {ComposerViewModel} from "./domain/session/room/ComposerViewModel.js"; export {ComposerViewModel} from "./domain/session/room/ComposerViewModel.js";
export {MessageComposer} from "./platform/web/ui/session/room/MessageComposer.js"; export {MessageComposer} from "./platform/web/ui/session/room/MessageComposer.js";
export {TemplateView} from "./platform/web/ui/general/TemplateView"; export {TemplateView} from "./platform/web/ui/general/TemplateView";

View file

@ -30,10 +30,10 @@ export class History extends BaseObservableValue {
But for SSO, we need to handle <root>/?loginToken=<TOKEN> But for SSO, we need to handle <root>/?loginToken=<TOKEN>
Handle that as a special case for now. Handle that as a special case for now.
*/ */
if (document.location.search.includes("loginToken")) { if (document?.location?.search.includes("loginToken")) {
return document.location.search; return document.location.search;
} }
return document.location.hash; return document?.location?.hash;
} }
/** does not emit */ /** does not emit */