fix: historical import loading state, remove stray catalog export
This commit is contained in:
parent
4dd01c13c4
commit
bb04966bbc
|
|
@ -96,12 +96,20 @@ export default function BillHistoricalImportDialog({ billId, billName, open, onC
|
|||
<Dialog open={open} onOpenChange={v => { if (!v) onClose(); }}>
|
||||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Past payments found</DialogTitle>
|
||||
<DialogTitle>
|
||||
{!loading && importable.length === 0 && alreadyDone.length === 0
|
||||
? 'No past payments found'
|
||||
: !loading && importable.length === 0
|
||||
? 'Already up to date'
|
||||
: 'Import past payments'}
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
{loading
|
||||
? 'Searching your bank history…'
|
||||
: importable.length === 0 && alreadyDone.length > 0
|
||||
? `All matching transactions for ${billName} are already linked — nothing left to import.`
|
||||
: importable.length === 0
|
||||
? `No past transactions found matching ${billName}.`
|
||||
? `No past bank transactions found matching ${billName}.`
|
||||
: `Found ${importable.length} past transaction${importable.length === 1 ? '' : 's'} matching ${billName}. What would you like to do?`}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
|
|
|||
|
|
@ -981,9 +981,6 @@ export default function SubscriptionsPage() {
|
|||
toast.success(`Linked ${result.matched_count} transaction${result.matched_count !== 1 ? 's' : ''} to "${result.bill_name}".`);
|
||||
setMatchTarget(null);
|
||||
setRecommendations(prev => prev.filter(r => r.id !== recommendation.id));
|
||||
if (getLinkImportPref() && recommendation.merchant) {
|
||||
setImportDialog({ billId, billName: result.bill_name || recommendation.name });
|
||||
}
|
||||
} catch (err) {
|
||||
toast.error(err.message || 'Could not link recommendation to bill.');
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue