Skip to content

Commit 71f3245

Browse files
fix(action-mapping): add initialActionCode reactive ref to share action state without route params
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2c6b3e2 commit 71f3245

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/helpers/ActionMapping.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6+
import { ref } from 'vue'
7+
68
interface ActionCodes {
79
REDIRECT: number
810
CREATE_ACCOUNT: number
@@ -53,6 +55,14 @@ export const ACTION_CODE_TO_ROUTE: Readonly<ActionCodeToRoute> = Object.freeze({
5355
[ACTION_CODES.INCOMPLETE_SETUP]: 'Incomplete',
5456
})
5557

58+
/**
59+
* Shared reactive ref for the initial action code injected by the server
60+
* (#initial-state-libresign-action). Written once by router.ts beforeEach,
61+
* read by App.vue. Lives here (not in router.ts) to avoid App.vue triggering
62+
* the router module's side effects (createRouter, generateUrl) on import.
63+
*/
64+
export const initialActionCode = ref(0)
65+
5666
export const REQUIREMENT_TO_MODAL: Readonly<RequirementToModal> = Object.freeze({
5767
identificationDocuments: 'uploadDocuments',
5868
emailCode: 'emailToken',

0 commit comments

Comments
 (0)