Giter Site home page Giter Site logo

Comments (2)

Sayan751 avatar Sayan751 commented on May 30, 2024 1

@aegenet Would you be interested in submitting a PR with the fix?

from aurelia.

aegenet avatar aegenet commented on May 30, 2024

Hello, until a fix is released, you can apply a "dirty" patch to Aurelia 2 using patch-package if you'd like. Use the following patch file:

./patches/@aurelia+router+2.0.0-beta.8.patch

diff --git a/node_modules/@aurelia/router/dist/esm/index.dev.mjs b/node_modules/@aurelia/router/dist/esm/index.dev.mjs
index 4d4a3b6..718e4e4 100644
--- a/node_modules/@aurelia/router/dist/esm/index.dev.mjs
+++ b/node_modules/@aurelia/router/dist/esm/index.dev.mjs
@@ -4978,6 +4978,10 @@ let Navigator = class Navigator {
         storeable.instruction = RoutingInstruction.stringify(this.container, storeable.instruction);
         // Make sure full state instruction is a string
         storeable.fullStateInstruction = RoutingInstruction.stringify(this.container, storeable.fullStateInstruction, false, true);
+        if (storeable.fullStateInstruction === '-' && (typeof navigation.fullStateInstruction === 'string' ? navigation.fullStateInstruction === '' : navigation.fullStateInstruction?.find(f => f.route?.matching === ''))) {
+            // '-' is ignored in the lifecycle...
+            storeable.fullStateInstruction = '';
+        }
         // Only string scopes can be stored
         if (typeof storeable.scope !== 'string') {
             storeable.scope = null;
diff --git a/node_modules/@aurelia/router/dist/esm/index.mjs b/node_modules/@aurelia/router/dist/esm/index.mjs
index cb8937c..809f965 100644
--- a/node_modules/@aurelia/router/dist/esm/index.mjs
+++ b/node_modules/@aurelia/router/dist/esm/index.mjs
@@ -3163,6 +3163,10 @@ let k = class Navigator {
         const i = t instanceof Navigation ? t.toStoredNavigation() : t;
         i.instruction = RoutingInstruction.stringify(this.container, i.instruction);
         i.fullStateInstruction = RoutingInstruction.stringify(this.container, i.fullStateInstruction, false, true);
+        if (i.fullStateInstruction === '-' && (typeof t.fullStateInstruction === 'string' ? t.fullStateInstruction === '' : t.fullStateInstruction?.find(f => f.route?.matching === ''))) {
+            // '-' is ignored in the lifecycle...
+            i.fullStateInstruction = '';
+        }
         if (typeof i.scope !== "string") {
             i.scope = null;
         }

from aurelia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.