From 44d45d1f0260c1208d99cb58e888bc6f2efbfe88 Mon Sep 17 00:00:00 2001 From: Philipp Otto Date: Mon, 24 Jun 2024 18:11:33 +0200 Subject: [PATCH] link 64-bit issue (#6921) in todo comments --- .../oxalis/model/sagas/mapping_saga.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/javascripts/oxalis/model/sagas/mapping_saga.ts b/frontend/javascripts/oxalis/model/sagas/mapping_saga.ts index 0b56fe1386c..1c8b2346e43 100644 --- a/frontend/javascripts/oxalis/model/sagas/mapping_saga.ts +++ b/frontend/javascripts/oxalis/model/sagas/mapping_saga.ts @@ -545,14 +545,11 @@ function* handleSetJsonMapping( function convertMappingObjectToEquivalenceClasses(existingMapping: Mapping) { const classesByRepresentative: Record = {}; - for (const unmapped of existingMapping.keys()) { - // @ts-ignore unmapped is guaranteed to exist in existingMapping as it was obtained using existingMapping.keys() - const mapped: number = existingMapping.get(unmapped); + for (let [unmapped, mapped] of existingMapping.entries()) { + // TODO: Proper 64 bit support (#6921) + unmapped = Number(unmapped); + mapped = Number(mapped); classesByRepresentative[mapped] = classesByRepresentative[mapped] || []; - if (typeof unmapped === "bigint") { - // todop - console.warn("Casting BigInt to Number for custom colors."); - } classesByRepresentative[mapped].push(Number(unmapped)); } const classes = Object.values(classesByRepresentative); @@ -577,10 +574,7 @@ function* setCustomColors( const hueValue = mappingProperties.mappingColors[classIdx]; const color = jsHsv2rgb(360 * hueValue, 1, 1); - if (typeof representativeId === "bigint") { - // todop - console.warn("Casting BigInt to Number for custom colors."); - } + // TODO: Proper 64 bit support (#6921) yield* put(updateSegmentAction(Number(representativeId), { color }, layerName)); classIdx++;