all filters + and add star inside checkbox
This commit is contained in:
@@ -156,3 +156,29 @@ export const sanitizeEmailHTML = (html: string): string => {
|
||||
return "خطا در نمایش محتوای ایمیل";
|
||||
}
|
||||
};
|
||||
|
||||
// Interface برای mailbox structure
|
||||
interface MailboxItem {
|
||||
id: string;
|
||||
name: string;
|
||||
unseen: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
// Utility function برای گرفتن mailbox id از localStorage
|
||||
export const getMailboxId = (mailboxName: string): string | null => {
|
||||
try {
|
||||
const mailboxesStr = localStorage.getItem("mailboxes");
|
||||
if (!mailboxesStr) return null;
|
||||
|
||||
const mailboxes: MailboxItem[] = JSON.parse(mailboxesStr);
|
||||
const mailbox = mailboxes.find(
|
||||
(mb: MailboxItem) => mb.name === mailboxName
|
||||
);
|
||||
|
||||
return mailbox?.id || null;
|
||||
} catch (error) {
|
||||
console.error("Error getting mailbox id:", error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user