From b094d66723ff412dd6b589c6700c26f31c131587 Mon Sep 17 00:00:00 2001 From: Scott Benton Date: Sun, 29 Oct 2023 23:01:03 -0400 Subject: [PATCH] fix(custom moves and oracles): Fixed incorrect ID being created --- src/hooks/useDataswornId.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useDataswornId.ts b/src/hooks/useDataswornId.ts index b8bda241..2461412d 100644 --- a/src/hooks/useDataswornId.ts +++ b/src/hooks/useDataswornId.ts @@ -1,5 +1,6 @@ import { GAME_SYSTEMS } from "types/GameSystems.type"; import { useGameSystemValue } from "./useGameSystemValue"; +import { encodeContents } from "functions/dataswornIdEncoder"; export function useDataswornId() { const systemPrefix = useGameSystemValue({ @@ -9,13 +10,17 @@ export function useDataswornId() { return { getId: (prefix: string, value: string) => { - return `${systemPrefix}/${prefix}/${value}`; + return `${systemPrefix}/${encodeContents(prefix)}/${encodeContents( + value + )}`; }, getCustomIdPrefix: (prefix: string) => { - return `${systemPrefix}/${prefix}/custom`; + return `${systemPrefix}/${encodeContents(prefix)}/custom`; }, getCustomId: (prefix: string, value: string) => { - return `${systemPrefix}/${prefix}/custom/${value}`; + return `${systemPrefix}/${encodeContents(prefix)}/custom/${encodeContents( + value + )}`; }, }; }