浏览代码

PG location.hash / loading update

Poolminer 4 年之前
父节点
当前提交
3c0ee9d4ed
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Playground/src/tools/loadManager.ts

+ 3 - 2
Playground/src/tools/loadManager.ts

@@ -7,11 +7,12 @@ export class LoadManager {
     public constructor(public globalState: GlobalState) {
     public constructor(public globalState: GlobalState) {
         // Check the url to prepopulate data
         // Check the url to prepopulate data
         this._checkHash();
         this._checkHash();
-        window.addEventListener("hashchange", () => this._checkHash());
+        window.addEventListener("hashchange", () => globalState.onLoadRequiredObservable.notifyObservers(location.hash));
 
 
         globalState.onLoadRequiredObservable.add((id) => {
         globalState.onLoadRequiredObservable.add((id) => {
             globalState.onDisplayWaitRingObservable.notifyObservers(true);
             globalState.onDisplayWaitRingObservable.notifyObservers(true);
-            window.location.hash = id;
+            location.hash = id;
+            this._loadPlayground(id);
         });
         });
     }
     }