feat: Update FaceAI upload panel and improve race storage metadata handling in tests
All checks were successful
Publish FaceAI Container / publish (push) Successful in 4m32s
All checks were successful
Publish FaceAI Container / publish (push) Successful in 4m32s
This commit is contained in:
parent
0926c52a00
commit
c0d072c6ea
6 changed files with 130 additions and 47 deletions
|
|
@ -116,7 +116,7 @@ const knownServerCodes = {
|
|||
RATE_LIMITED: 'rateLimited',
|
||||
MISSING_SELFIE: 'chooseSelfie',
|
||||
RACE_PKL_UNAVAILABLE: 'raceDataUnavailable',
|
||||
RACE_DIRECTORY_NOT_FOUND: 'invalidRaceData',
|
||||
RACE_DIRECTORY_NOT_FOUND: 'raceDataUnavailable',
|
||||
MISSING_RACE_STORAGE: 'invalidRaceData'
|
||||
};
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ const simulatorUrl = legacyUrl('/faceai_simulator.php?raceId=101&lang=it');
|
|||
const legacyHomeUrl = legacyUrl('/');
|
||||
|
||||
function isInvalidRaceAvailability(availability) {
|
||||
return availability?.reasonCode === 'RACE_DIRECTORY_NOT_FOUND' || availability?.reasonCode === 'MISSING_RACE_STORAGE';
|
||||
return availability?.reasonCode === 'MISSING_RACE_STORAGE';
|
||||
}
|
||||
|
||||
function buildLegacyReturnUrl(url) {
|
||||
|
|
@ -204,8 +204,9 @@ export function useFaceAiHome() {
|
|||
}
|
||||
|
||||
function getAvailabilityUserMessage(availability, fallbackKey = 'unavailableDefault') {
|
||||
if (isInvalidRaceAvailability(availability)) {
|
||||
return t('invalidRaceData');
|
||||
const mappedCodeKey = availability?.reasonCode ? knownServerCodes[availability.reasonCode] : null;
|
||||
if (mappedCodeKey) {
|
||||
return t(mappedCodeKey);
|
||||
}
|
||||
|
||||
return localizeServerMessage(availability?.message, fallbackKey);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue