kenso war das
This commit is contained in:
@@ -107,7 +107,7 @@ export class GmailService {
|
||||
|
||||
/**
|
||||
* Create or get a label
|
||||
* @param {string} name - Label name (e.g., "EmailSorter/VIP")
|
||||
* @param {string} name - Label name (e.g., "MailFlow/VIP")
|
||||
* @param {string} color - Optional label color (must be from Gmail's palette)
|
||||
*/
|
||||
async createLabel(name, color = null) {
|
||||
@@ -272,14 +272,14 @@ export class GmailService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup old EmailSorter labels
|
||||
* Removes all labels starting with "EmailSorter/" and old German labels
|
||||
* Cleanup old MailFlow labels
|
||||
* Removes all labels starting with "MailFlow/" and old German labels
|
||||
*/
|
||||
async cleanupOldLabels() {
|
||||
// Old labels to remove (German and old format)
|
||||
const OLD_LABELS = [
|
||||
// Old "EmailSorter/" prefix labels
|
||||
'EmailSorter/',
|
||||
// Old "MailFlow/" prefix labels
|
||||
'MailFlow/',
|
||||
// Old German labels
|
||||
'Wichtig', 'Kunden', 'Rechnungen', 'Sicherheit', 'Termine', 'Prüfen', 'Werbung',
|
||||
'VIP / Wichtig', 'Kunden / Projekte', 'Rechnungen / Belege',
|
||||
@@ -293,8 +293,8 @@ export class GmailService {
|
||||
// Filter labels that match old patterns
|
||||
const labelsToDelete = labels.filter(l => {
|
||||
if (!l.name) return false
|
||||
// Check for EmailSorter/ prefix
|
||||
if (l.name.startsWith('EmailSorter/')) return true
|
||||
// Check for MailFlow/ prefix
|
||||
if (l.name.startsWith('MailFlow/')) return true
|
||||
// Check for exact matches with old labels
|
||||
if (OLD_LABELS.includes(l.name)) return true
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user