Apply prettier formatting
This commit is contained in:
@@ -24,7 +24,7 @@ import { parseQsFromFragment } from "./url_utils";
|
||||
|
||||
let lastLocationHashSet: string = null;
|
||||
|
||||
export function getScreenFromLocation(location: Location): { screen: string, params: QueryDict } {
|
||||
export function getScreenFromLocation(location: Location): { screen: string; params: QueryDict } {
|
||||
const fragparts = parseQsFromFragment(location);
|
||||
return {
|
||||
screen: fragparts.location.substring(1),
|
||||
@@ -54,11 +54,12 @@ function onHashChange(): void {
|
||||
// so a web page can update the URL bar appropriately.
|
||||
export function onNewScreen(screen: string, replaceLast = false): void {
|
||||
logger.log("newscreen " + screen);
|
||||
const hash = '#/' + screen;
|
||||
const hash = "#/" + screen;
|
||||
lastLocationHashSet = hash;
|
||||
|
||||
// if the new hash is a substring of the old one then we are stripping fields e.g `via` so replace history
|
||||
if (screen.startsWith("room/") &&
|
||||
if (
|
||||
screen.startsWith("room/") &&
|
||||
window.location.hash.includes("/$") === hash.includes("/$") && // only if both did or didn't contain event link
|
||||
window.location.hash.startsWith(hash)
|
||||
) {
|
||||
@@ -73,5 +74,5 @@ export function onNewScreen(screen: string, replaceLast = false): void {
|
||||
}
|
||||
|
||||
export function init(): void {
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
window.addEventListener("hashchange", onHashChange);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user