From ab6a020455c0f571540fa059bc0281672028de98 Mon Sep 17 00:00:00 2001 From: Frank R Date: Tue, 28 Nov 2023 19:08:05 +0100 Subject: [PATCH] split hash in chunks of 3 chars when entering --- frontend/src/store/slices/registrationSlice.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/store/slices/registrationSlice.ts b/frontend/src/store/slices/registrationSlice.ts index ba7cd3b..0a226ba 100644 --- a/frontend/src/store/slices/registrationSlice.ts +++ b/frontend/src/store/slices/registrationSlice.ts @@ -34,7 +34,12 @@ export const registrationSlice = createSlice({ state.name = action.payload; }, updateHash: (state, action: PayloadAction) => { - state.hash = action.payload.replace("#", ""); + state.hash = action.payload + .replace("#", "") + .replaceAll(" ", "") + .split(/(.{3})/) + .filter(e => e) + .join(" "); }, }, });