fix: complete jump-hop frontend wiring

This commit is contained in:
kdletters
2026-05-22 06:19:59 +08:00
parent 7b8cb82bf0
commit 1756b83789
10 changed files with 132 additions and 2 deletions

View File

@@ -67,6 +67,14 @@ export function buildBarkBattlePublicWorkCode(workId: string) {
return `BB-${normalizeBarkBattlePublicWorkCodeSuffix(workId)}`;
}
export function buildJumpHopPublicWorkCode(profileId: string) {
const normalized = normalizePublicCodeText(profileId);
const fallback = normalized || '00000000';
const suffix = fallback.slice(-8).padStart(8, '0');
return `JH-${suffix}`;
}
export function isSamePuzzlePublicWorkCode(keyword: string, profileId: string) {
const normalizedKeyword = normalizePublicCodeText(keyword);
@@ -149,3 +157,13 @@ export function isSameBarkBattlePublicWorkCode(keyword: string, workId: string)
normalizedKeyword === normalizeBarkBattlePublicWorkCodeSuffix(workId)
);
}
export function isSameJumpHopPublicWorkCode(keyword: string, profileId: string) {
const normalizedKeyword = normalizePublicCodeText(keyword);
return (
normalizedKeyword ===
normalizePublicCodeText(buildJumpHopPublicWorkCode(profileId)) ||
normalizedKeyword === normalizePublicCodeText(profileId)
);
}