diff --git a/app/folders/page.tsx b/app/folders/page.tsx index 7c24bc0..6ac18e3 100644 --- a/app/folders/page.tsx +++ b/app/folders/page.tsx @@ -56,7 +56,10 @@ function FolderTreeItem({ }: FolderTreeItemProps) { const [isExpanded, setIsExpanded] = useState(true) - const folderAccounts = accounts.filter((a) => a.folderId === folder.id) + // Pour le dossier racine, inclure aussi les comptes sans dossier (folderId: null) + const folderAccounts = accounts.filter((a) => + a.folderId === folder.id || (folder.parentId === null && a.folderId === null) + ) const childFolders = allFolders.filter((f) => f.parentId === folder.id) const hasChildren = childFolders.length > 0 || folderAccounts.length > 0 diff --git a/components/import/ofx-import-dialog.tsx b/components/import/ofx-import-dialog.tsx index 9c8c111..a994b7e 100644 --- a/components/import/ofx-import-dialog.tsx +++ b/components/import/ofx-import-dialog.tsx @@ -88,7 +88,7 @@ export function OFXImportDialog({ children, onImportComplete }: OFXImportDialogP bankId: parsed.bankId, accountNumber: parsed.accountId, type: parsed.accountType as Account["type"], - folderId: null, + folderId: "folder-root", balance: parsed.balance, currency: parsed.currency, lastImport: new Date().toISOString(),