Skip to content

Commit

Permalink
fix: csv import deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Sep 17, 2024
1 parent 420aad0 commit c5ef92c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect, useMemo, useCallback } from 'react';

import * as d from 'date-fns';
import deepEqual from 'deep-equal';

import { format as formatDate_ } from 'loot-core/src/shared/months';
import {
Expand Down Expand Up @@ -922,8 +923,8 @@ export function ImportTransactionsModal({ options }) {
);
break;
}
if (trans.payee == null || !(trans.payee instanceof String)) {
console.log(`Unable·to·parse·payee·${trans.payee || '(empty)'}`);
if (trans.payee_name == null || typeof trans.payee_name !== 'string') {
console.log(`Unable·to·parse·payee·${trans.payee_name || '(empty)'}`);
break;
}

Expand Down Expand Up @@ -1379,7 +1380,10 @@ export function ImportTransactionsModal({ options }) {
outValue,
multiplierAmount,
);
setTransactions(transactionPreview);

if (!deepEqual(transactions, transactionPreview)) {
setTransactions(transactionPreview);
}
}, [
getImportPreview,
transactions,
Expand Down

0 comments on commit c5ef92c

Please sign in to comment.