Fix bug on errror resolution.

This commit is contained in:
Paulo Gustavo Veiga 2022-03-16 22:01:37 -03:00
parent b3843e7f88
commit f5600cbe6e

View File

@ -57,8 +57,8 @@ export const fetchMapById = (id: number): MapLoadResult => {
} }
// Seach for object... // Seach for object...
map = data?.find((m) => m.id == id); map = data?.find((m) => m.id == id);
if (map === null && !errorMsg) { if (!map && !errorMsg) {
errorMsg = { msg: `Map with id ${id} could not be found. Please, reflesh the page` } errorMsg = { msg: `Map with id ${id} could not be found. Please, reflesh the page. Map: ${JSON.stringify(data)}` }
} }
} }
return { isLoading: isLoading, error: errorMsg, map: map }; return { isLoading: isLoading, error: errorMsg, map: map };