mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feat-75] use map hash for comparing
This commit is contained in:
+3
-6
@@ -131,12 +131,9 @@ export const LocalMapsListPanel = forwardRef<LocalMapsListPanelRef, Props>(({ ve
|
||||
const mapsCopy = maps ? [ ...maps ] : [];
|
||||
|
||||
for (const importMap of importMaps) {
|
||||
if (importMap.songDetails) {
|
||||
// importMap can collide with existing map
|
||||
const index = maps.findIndex(map => map.songDetails?.name === importMap.songDetails.name);
|
||||
if (index > -1) {
|
||||
mapsCopy.splice(index, 1);
|
||||
}
|
||||
const index = mapsCopy.findIndex(map => map.hash === importMap.hash);
|
||||
if (index > -1) {
|
||||
mapsCopy.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user