Browse Source

Merge pull request #8037 from RaananW/correctQueryParamsInPG

Correct query params in pg
David Catuhe 5 years ago
parent
commit
ee59aa3074
2 changed files with 3 additions and 3 deletions
  1. 2 3
      Playground/js/main.js
  2. 1 0
      dist/preview release/what's new.md

+ 2 - 3
Playground/js/main.js

@@ -566,7 +566,7 @@ class Main {
                         exampleList.appendChild(noResultContainer);
                         exampleList.appendChild(noResultContainer);
                     }
                     }
 
 
-                    if (!location.hash && restoreVersionResult == false) {
+                    if (!location.hash && restoreVersionResult == false && (location.pathname === '/' || !location.pathname)) {
                         // Query string
                         // Query string
                         var queryString = window.location.search;
                         var queryString = window.location.search;
 
 
@@ -1016,12 +1016,11 @@ class Main {
     };
     };
     checkHash() {
     checkHash() {
         let pgHash = "";
         let pgHash = "";
-        if (location.search) {
+        if (location.search && (!location.pathname  || location.pathname === '/') && !location.hash) {
             var query = this.parseQuery(location.search);
             var query = this.parseQuery(location.search);
             if (query.pg) {
             if (query.pg) {
                 pgHash = "#" + query.pg + "#" + (query.revision || "0")
                 pgHash = "#" + query.pg + "#" + (query.revision || "0")
             }
             }
-
         } else if (location.hash) {
         } else if (location.hash) {
             if (this.previousHash !== location.hash) {
             if (this.previousHash !== location.hash) {
                 this.cleanHash();
                 this.cleanHash();

+ 1 - 0
dist/preview release/what's new.md

@@ -151,6 +151,7 @@
 - Fix bug with multiple scenes when resizing the screen and there's a glow or highlight layer active ([Popov72](https://github.com/Popov72)
 - Fix bug with multiple scenes when resizing the screen and there's a glow or highlight layer active ([Popov72](https://github.com/Popov72)
 - Fix an error when compiling with the closure compiler ([ageneau](https://github.com/ageneau/))
 - Fix an error when compiling with the closure compiler ([ageneau](https://github.com/ageneau/))
 - Fix an error in applying texture to sides of `extrudePolygon` using faceUV[1] ([JohnK](https://github.com/BabylonJSGuide/))
 - Fix an error in applying texture to sides of `extrudePolygon` using faceUV[1] ([JohnK](https://github.com/BabylonJSGuide/))
+- Playground didn't work if query params were added to the URL ([RaananW](https://github.com/RaananW))
 
 
 ## Breaking changes
 ## Breaking changes