|
@@ -1327,8 +1327,11 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
|
|
|
|
|
|
|
|
// print("Deleting old data scope: ${mapsToInsert.length}");
|
|
// print("Deleting old data scope: ${mapsToInsert.length}");
|
|
|
final keys2check = idToRemove[data.filename]!;
|
|
final keys2check = idToRemove[data.filename]!;
|
|
|
- final mawjoudin = oldComparable.fold(<Map<String, dynamic>>{},
|
|
|
|
|
- (t, e) => {...t, extractMapWithKeys(e, keys2check)}).toList();
|
|
|
|
|
|
|
+ final mawjoudin = oldComparable.fold(<Map<String, dynamic>>[], (t, e) {
|
|
|
|
|
+ t.add(extractMapWithKeys(e, keys2check));
|
|
|
|
|
+ return t;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
for (int i = 0; i < oldComparable.length; i++) {
|
|
for (int i = 0; i < oldComparable.length; i++) {
|
|
|
final item = oldComparable[i];
|
|
final item = oldComparable[i];
|
|
|
final index = findIndex(mapsToInsert, item);
|
|
final index = findIndex(mapsToInsert, item);
|
|
@@ -1340,12 +1343,14 @@ processCsvData(File tempfile, SupabaseClient supabase) async {
|
|
|
(e) => mapEquals(extractMapWithKeys(item, keys2check), e),
|
|
(e) => mapEquals(extractMapWithKeys(item, keys2check), e),
|
|
|
orElse: () => {})
|
|
orElse: () => {})
|
|
|
.keys
|
|
.keys
|
|
|
- .isEmpty;
|
|
|
|
|
|
|
+ .isNotEmpty;
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
|
indexToMaintain.add(i);
|
|
indexToMaintain.add(i);
|
|
|
mapsToInsert.removeAt(index);
|
|
mapsToInsert.removeAt(index);
|
|
|
} else if (mawjood) {
|
|
} else if (mawjood) {
|
|
|
indexToRemove.add(i);
|
|
indexToRemove.add(i);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ print("saved item: $item");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|