1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-12-20 00:12:26 +02:00

Chore: Apply linting to all JavaScript/Vue files with eslint & prettier

This commit is contained in:
Ralph Slooten
2025-06-20 23:26:06 +12:00
parent 7dee371721
commit 3fff79e29f
45 changed files with 8690 additions and 3458 deletions

View File

@@ -1,92 +1,94 @@
// State Management
import { reactive, watch } from 'vue'
import { reactive, watch } from "vue";
// global mailbox info
export const mailbox = reactive({
total: 0, // total number of messages in database
unread: 0, // total unread messages in database
count: 0, // total in mailbox or search
messages: [], // current messages
tags: [], // all tags
selected: [], // currently selected
connected: false, // websocket connection
searching: false, // current search, false for none
refresh: false, // to listen from MessagesMixin
autoPaginating: true, // allows temporary bypass of loadMessages() via auto-pagination
notificationsSupported: false, // browser supports notifications
notificationsEnabled: false, // user has enabled notifications
skipConfirmations: false, // skip modal confirmations for "Delete all" & "mark all read"
appInfo: {}, // application information
uiConfig: {}, // configuration for UI
lastMessage: false, // return scrolling
total: 0, // total number of messages in database
unread: 0, // total unread messages in database
count: 0, // total in mailbox or search
messages: [], // current messages
tags: [], // all tags
selected: [], // currently selected
connected: false, // websocket connection
searching: false, // current search, false for none
refresh: false, // to listen from MessagesMixin
autoPaginating: true, // allows temporary bypass of loadMessages() via auto-pagination
notificationsSupported: false, // browser supports notifications
notificationsEnabled: false, // user has enabled notifications
skipConfirmations: false, // skip modal confirmations for "Delete all" & "mark all read"
appInfo: {}, // application information
uiConfig: {}, // configuration for UI
lastMessage: false, // return scrolling
// settings
showTagColors: !localStorage.getItem('hideTagColors') == '1',
showHTMLCheck: !localStorage.getItem('hideHTMLCheck') == '1',
showLinkCheck: !localStorage.getItem('hideLinkCheck') == '1',
showSpamCheck: !localStorage.getItem('hideSpamCheck') == '1',
timeZone: localStorage.getItem('timeZone') ? localStorage.getItem('timeZone') : Intl.DateTimeFormat().resolvedOptions().timeZone,
})
showTagColors: !localStorage.getItem("hideTagColors"),
showHTMLCheck: !localStorage.getItem("hideHTMLCheck"),
showLinkCheck: !localStorage.getItem("hideLinkCheck"),
showSpamCheck: !localStorage.getItem("hideSpamCheck"),
timeZone: localStorage.getItem("timeZone")
? localStorage.getItem("timeZone")
: Intl.DateTimeFormat().resolvedOptions().timeZone,
});
watch(
() => mailbox.count,
(v) => {
mailbox.selected = []
}
)
mailbox.selected = [];
},
);
watch(
() => mailbox.showTagColors,
(v) => {
if (v) {
localStorage.removeItem('hideTagColors')
localStorage.removeItem("hideTagColors");
} else {
localStorage.setItem('hideTagColors', '1')
localStorage.setItem("hideTagColors", "1");
}
}
)
},
);
watch(
() => mailbox.showHTMLCheck,
(v) => {
if (v) {
localStorage.removeItem('hideHTMLCheck')
localStorage.removeItem("hideHTMLCheck");
} else {
localStorage.setItem('hideHTMLCheck', '1')
localStorage.setItem("hideHTMLCheck", "1");
}
}
)
},
);
watch(
() => mailbox.showLinkCheck,
(v) => {
if (v) {
localStorage.removeItem('hideLinkCheck')
localStorage.removeItem("hideLinkCheck");
} else {
localStorage.setItem('hideLinkCheck', '1')
localStorage.setItem("hideLinkCheck", "1");
}
}
)
},
);
watch(
() => mailbox.showSpamCheck,
(v) => {
if (v) {
localStorage.removeItem('hideSpamCheck')
localStorage.removeItem("hideSpamCheck");
} else {
localStorage.setItem('hideSpamCheck', '1')
localStorage.setItem("hideSpamCheck", "1");
}
}
)
},
);
watch(
() => mailbox.timeZone,
(v) => {
if (v == Intl.DateTimeFormat().resolvedOptions().timeZone) {
localStorage.removeItem('timeZone')
if (v === Intl.DateTimeFormat().resolvedOptions().timeZone) {
localStorage.removeItem("timeZone");
} else {
localStorage.setItem('timeZone', v)
localStorage.setItem("timeZone", v);
}
}
)
},
);