add archive progress styles

This commit is contained in:
qcrao
2024-07-25 16:52:23 +08:00
parent 4f9cd6a9aa
commit fd34ee6450
4 changed files with 66 additions and 26 deletions

View File

@@ -13,9 +13,20 @@ async function bulkArchiveConversations() {
sendEventAsync("archive", selectedConversations.length);
for (const element of selectedConversations) {
await archiveConversation(element);
for (let i = 0; i < selectedConversations.length; i++) {
await archiveConversation(selectedConversations[i]);
const progress = Math.round(((i + 1) / selectedConversations.length) * 100);
chrome.runtime.sendMessage({
action: "updateProgress",
buttonId: "bulk-archive",
progress: progress,
});
}
chrome.runtime.sendMessage({
action: "operationComplete",
buttonId: "bulk-archive",
});
}
function getSelectedConversations() {