backend-plus 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -531,14 +531,29 @@ myOwn.informDetectedStatus = function informDetectedStatus(statusCode, logged) {
531
531
  }
532
532
  }
533
533
 
534
+ var lastUrl = window.location.href;
535
+ //TODO: desacoplar de BP
534
536
  window.addEventListener('popstate', function(){
535
- if(!my.config){
536
- my.autoSetup().then(function(){
537
- my.showPage();
538
- })
539
- }else{
540
- my.showPage();
537
+ function checkReactUrl(url){
538
+ const regex = /\/react(\/.*)?$/;
539
+ return regex.test(url);
541
540
  }
541
+ const currentUrl = window.location.href;
542
+ if(checkReactUrl(currentUrl)){
543
+ if(!checkReactUrl(lastUrl))
544
+ location.reload();
545
+ }else{
546
+ setTimeout(function(){
547
+ if(!my.config){
548
+ my.autoSetup().then(function(){
549
+ my.showPage();
550
+ })
551
+ }else{
552
+ my.showPage();
553
+ }
554
+ },10)
555
+ }
556
+ lastUrl = currentUrl;
542
557
  });
543
558
 
544
559
  window.addEventListener('load', function(){
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.1.2",
4
+ "version": "2.1.3",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",