courrier multi account restore compose
This commit is contained in:
parent
f7d6bfb8d2
commit
6431f8d908
@ -122,7 +122,7 @@ export default function EmailLayout({ className = '' }: EmailLayoutProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle email selection
|
// Handle email selection
|
||||||
const handleEmailSelect = (id: string) => {
|
const handleEmailSelect = (id: string, accountId: string, folder: string) => {
|
||||||
setSelectedEmailId(id);
|
setSelectedEmailId(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ export default function EmailLayout({ className = '' }: EmailLayoutProps) {
|
|||||||
className={`p-3 hover:bg-secondary/20 cursor-pointer transition-colors ${
|
className={`p-3 hover:bg-secondary/20 cursor-pointer transition-colors ${
|
||||||
selectedEmailId === email.id ? 'bg-secondary/30' : ''
|
selectedEmailId === email.id ? 'bg-secondary/30' : ''
|
||||||
} ${!email.flags.seen ? 'bg-primary/5' : ''}`}
|
} ${!email.flags.seen ? 'bg-primary/5' : ''}`}
|
||||||
onClick={() => handleEmailSelect(email.id)}
|
onClick={() => handleEmailSelect(email.id, email.accountId || '', email.folder || '')}
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-2">
|
<div className="flex items-start gap-2">
|
||||||
<div className="pt-0.5">
|
<div className="pt-0.5">
|
||||||
|
|||||||
@ -16,7 +16,7 @@ interface EmailListProps {
|
|||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
totalEmails: number;
|
totalEmails: number;
|
||||||
hasMoreEmails: boolean;
|
hasMoreEmails: boolean;
|
||||||
onSelectEmail: (emailId: string) => void;
|
onSelectEmail: (emailId: string, accountId: string, folder: string) => void;
|
||||||
onToggleSelect: (emailId: string) => void;
|
onToggleSelect: (emailId: string) => void;
|
||||||
onToggleSelectAll: () => void;
|
onToggleSelectAll: () => void;
|
||||||
onBulkAction: (action: 'delete' | 'mark-read' | 'mark-unread' | 'archive') => void;
|
onBulkAction: (action: 'delete' | 'mark-read' | 'mark-unread' | 'archive') => void;
|
||||||
@ -153,7 +153,7 @@ export default function EmailList({
|
|||||||
email={email}
|
email={email}
|
||||||
isSelected={selectedEmailIds.includes(email.id)}
|
isSelected={selectedEmailIds.includes(email.id)}
|
||||||
isActive={selectedEmail?.id === email.id}
|
isActive={selectedEmail?.id === email.id}
|
||||||
onSelect={() => onSelectEmail(email.id)}
|
onSelect={() => onSelectEmail(email.id, email.accountId || '', email.folder || '')}
|
||||||
onToggleSelect={(e: React.MouseEvent) => {
|
onToggleSelect={(e: React.MouseEvent) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onToggleSelect(email.id);
|
onToggleSelect(email.id);
|
||||||
|
|||||||
@ -289,11 +289,11 @@ export const useCourrier = () => {
|
|||||||
}, [currentFolder]);
|
}, [currentFolder]);
|
||||||
|
|
||||||
// Select an email to view
|
// Select an email to view
|
||||||
const handleEmailSelect = useCallback(async (emailId: string, accountId?: string, folderOverride?: string) => {
|
const handleEmailSelect = useCallback(async (emailId: string, accountId: string, folderOverride: string) => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
// Find the email in the current list
|
// Find the email in the current list
|
||||||
const email = emails.find(e => e.id === emailId && (!accountId || e.accountId === accountId) && (!folderOverride || e.folder === folderOverride));
|
const email = emails.find(e => e.id === emailId && e.accountId === accountId && e.folder === folderOverride);
|
||||||
if (!email) {
|
if (!email) {
|
||||||
throw new Error('Email not found');
|
throw new Error('Email not found');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user