Move runningFromConsole to utils

This commit is contained in:
Pieter Vander Vennet 2021-01-06 02:21:50 +01:00
parent c359d43b15
commit 66018cb421
9 changed files with 73 additions and 66 deletions

View file

@ -1,10 +1,15 @@
import {UIEventSource} from "../UIEventSource";
import Constants from "../../Models/Constants";
import {Utils} from "../../Utils";
export default class Hash {
public static hash : UIEventSource<string> = Hash.Get();
private static Get() : UIEventSource<string>{
if(Utils.runningFromConsole){
return new UIEventSource<string>(undefined);
}
const hash = new UIEventSource<string>(window.location.hash.substr(1));
hash.addCallback(h => {
if(h === undefined || h === ""){