Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b14209a5ae |
@@ -27,7 +27,7 @@ npm run android:apk
|
||||
|
||||
The debug APK is written to `android/app/build/outputs/apk/debug/app-debug.apk` and copied to `release/ep-mail <version>-debug.apk`; install it on a connected test device with `adb install -r android/app/build/outputs/apk/debug/app-debug.apk`. For a signed release, configure `EP_MAIL_ANDROID_STORE_FILE` (an absolute path), `EP_MAIL_ANDROID_STORE_PASSWORD`, `EP_MAIL_ANDROID_KEY_ALIAS`, and `EP_MAIL_ANDROID_KEY_PASSWORD` in the build environment, then run `npm run android:release-apk`. The signed artifact is copied to `release/ep-mail <version>.apk`; keep keystores and passwords out of the repository and logs. The first account enables a visible, ongoing foreground-service notification while IMAP IDLE checks for new mail; Android also runs a network-constrained periodic reconciliation. Notification sender/subject details are hidden by default; enabling them in Settings still keeps lock-screen previews redacted. Android may delay or stop background activity after force-stop, prolonged device restrictions, or vendor battery management.
|
||||
|
||||
On Android, previously cached inbox messages appear while the mailbox refreshes. The app stays in the message list until you select a message; returning to the list does not automatically reopen the newest message.
|
||||
On Android, previously cached folder messages appear while the mailbox refreshes; a folder without cached messages still needs to load from the server. The app stays in the message list until you select a message; returning to the list does not automatically reopen the newest message.
|
||||
|
||||
## Run on Windows or Linux
|
||||
|
||||
|
||||
@@ -464,6 +464,7 @@ internal object AndroidMailService {
|
||||
return saveAttachmentBytes(context, filename, contentType, Base64.decode(encoded, Base64.DEFAULT))
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun flushOutbox(account: JSONObject) {
|
||||
val accountId = account.optString("id")
|
||||
val queued = AndroidAccountVault.pendingMailOperations(accountId)
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.getcapacitor.PluginMethod
|
||||
import com.getcapacitor.annotation.CapacitorPlugin
|
||||
import java.util.Locale
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.Executors
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import javax.mail.internet.InternetAddress
|
||||
@@ -24,6 +25,8 @@ import javax.crypto.Cipher
|
||||
class EpMailPlugin : Plugin() {
|
||||
private var syncReceiver: BroadcastReceiver? = null
|
||||
private var wipeDialogShowing = false
|
||||
private val mailboxExecutor = Executors.newFixedThreadPool(3)
|
||||
private val outboxExecutor = Executors.newSingleThreadExecutor()
|
||||
|
||||
override fun load() {
|
||||
AndroidAccountVault.initialize(context)
|
||||
@@ -58,6 +61,8 @@ class EpMailPlugin : Plugin() {
|
||||
}
|
||||
|
||||
override fun handleOnDestroy() {
|
||||
mailboxExecutor.shutdown()
|
||||
outboxExecutor.shutdown()
|
||||
syncReceiver?.let {
|
||||
try { context.unregisterReceiver(it) } catch (_: IllegalArgumentException) {}
|
||||
}
|
||||
@@ -522,10 +527,31 @@ class EpMailPlugin : Plugin() {
|
||||
val selected = filterFolder?.takeIf { it in setOf("Inbox", "Sent", "Archive", "Trash", "Starred") } ?: requested
|
||||
val folder = if (selected in setOf("Inbox", "Sent", "Archive", "Trash", "Starred", "Snoozed") || AndroidMailService.isCustomFolder(selected)) selected else "Inbox"
|
||||
val offset = (call.getInt("offset") ?: 0).coerceAtLeast(0)
|
||||
AndroidMailService.flushOutbox(account)
|
||||
mailboxExecutor.execute {
|
||||
try {
|
||||
call.resolve(AndroidMailService.sync(account, folder, offset, JSONObject(filters.toString())).toJSObject())
|
||||
} catch (error: Exception) {
|
||||
call.reject(error.message ?: "Could not sync the mailbox.")
|
||||
return@execute
|
||||
}
|
||||
retryOutbox(account)
|
||||
}
|
||||
} catch (error: Exception) {
|
||||
call.reject(error.message ?: "Could not sync the mailbox.")
|
||||
}
|
||||
}
|
||||
|
||||
private fun retryOutbox(account: JSONObject) {
|
||||
try {
|
||||
outboxExecutor.execute {
|
||||
try {
|
||||
AndroidMailService.flushOutbox(account)
|
||||
} catch (error: Exception) {
|
||||
android.util.Log.e("EpMailOutbox", "Could not retry queued mail operations", error)
|
||||
}
|
||||
}
|
||||
} catch (error: java.util.concurrent.RejectedExecutionException) {
|
||||
android.util.Log.w("EpMailOutbox", "Could not schedule queued mail retry", error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/ep_splash_icon"
|
||||
android:inset="22dp" />
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<foreground android:drawable="@drawable/ep_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<foreground android:drawable="@drawable/ep_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,9 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/ic_launcher_background" />
|
||||
<item
|
||||
android:drawable="@drawable/ep_splash_icon"
|
||||
android:left="5dp"
|
||||
android:top="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp" />
|
||||
</layer-list>
|
||||
@@ -0,0 +1,13 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/ic_launcher_background" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:drawable="@drawable/ep_splash_icon"
|
||||
android:left="5dp"
|
||||
android:top="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp" />
|
||||
</layer-list>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
<color name="ic_launcher_background">#0a0c0b</color>
|
||||
</resources>
|
||||
+34
-2
@@ -11,6 +11,8 @@ const mailFeatureState = {
|
||||
total: 0,
|
||||
syncPromise: null,
|
||||
syncQueued: false,
|
||||
syncMailboxKey: null,
|
||||
displayedMailboxKey: null,
|
||||
refreshPending: false,
|
||||
folderBeforeSearch: null,
|
||||
customFolders: [],
|
||||
@@ -648,21 +650,41 @@ function setupDraftComposer() {
|
||||
}
|
||||
|
||||
async function syncMailbox(showToast, options = {}) {
|
||||
const isAndroid = window.daybreakMail?.platform === 'android';
|
||||
const mailboxKey = JSON.stringify([mailFeatureState.connectedAccount?.id, rendererState.activeFolder]);
|
||||
if (mailFeatureState.syncPromise) {
|
||||
if (!isAndroid || mailFeatureState.syncMailboxKey === mailboxKey) {
|
||||
mailFeatureState.syncQueued = true;
|
||||
return mailFeatureState.syncPromise;
|
||||
}
|
||||
mailFeatureState.syncQueued = false;
|
||||
}
|
||||
if (!mailFeatureState.connectedAccount || !window.daybreakMail) {
|
||||
openMailAccount();
|
||||
return;
|
||||
}
|
||||
const refresh = selectMailUi('#refresh');
|
||||
if (refresh) refresh.disabled = true;
|
||||
const request = {};
|
||||
mailFeatureState.syncRequest = request;
|
||||
mailFeatureState.syncMailboxKey = mailboxKey;
|
||||
const sync = (async () => {
|
||||
let showingCachedMessages = false;
|
||||
try {
|
||||
if (isAndroid && mailFeatureState.displayedMailboxKey !== mailboxKey) {
|
||||
mailFeatureState.displayedMailboxKey = mailboxKey;
|
||||
rendererState.messages.splice(0, rendererState.messages.length);
|
||||
rendererState.activeMessage = null;
|
||||
rendererState.selectedIds.clear();
|
||||
document.body.classList.remove('reader-open');
|
||||
selectMailUi('#reader-pane').innerHTML = appShell.emptyReader();
|
||||
appShell.renderList();
|
||||
const status = selectMailUi('#mail-status');
|
||||
if (status) status.textContent = 'Loading folder…';
|
||||
}
|
||||
if (rendererState.activeFolder === 'Drafts') {
|
||||
const result = await window.daybreakMail.listDrafts();
|
||||
if (isAndroid && mailFeatureState.syncRequest !== request) return;
|
||||
renderDrafts(result.drafts || []);
|
||||
if (showToast) toastMailUi(`${result.drafts.length} saved drafts`);
|
||||
return;
|
||||
@@ -671,19 +693,27 @@ async function syncMailbox(showToast, options = {}) {
|
||||
const accountId = mailFeatureState.connectedAccount.id;
|
||||
const offset = options.offset ?? (options.append ? mailFeatureState.pageOffset + rendererState.messages.length : mailFeatureState.pageOffset);
|
||||
const filters = mailSearchFilters();
|
||||
const isCurrentMailbox = () => rendererState.activeFolder === folder && mailFeatureState.connectedAccount?.id === accountId;
|
||||
const isCurrentMailbox = () => rendererState.activeFolder === folder && mailFeatureState.connectedAccount?.id === accountId &&
|
||||
(!isAndroid || mailFeatureState.syncRequest === request);
|
||||
if (window.daybreakMail.getCachedFolder && !options.append && offset === 0 && !rendererState.messages.length) {
|
||||
try {
|
||||
const cached = await window.daybreakMail.getCachedFolder(folder, offset, filters);
|
||||
if (cached && isCurrentMailbox()) {
|
||||
rendererState.messages.splice(0, rendererState.messages.length, ...cached.messages);
|
||||
rendererState.activeMessage = null;
|
||||
mailFeatureState.pageOffset = offset;
|
||||
mailFeatureState.total = cached.total;
|
||||
const pagination = selectMailUi('#pagination');
|
||||
if (pagination) pagination.textContent = cached.total ? `${cached.start}–${cached.end} of ${cached.total} saved messages` : '0 saved messages';
|
||||
const loadMore = selectMailUi('#load-more');
|
||||
if (loadMore) loadMore.classList.toggle('hidden', cached.messages.length >= cached.total);
|
||||
appShell.renderList();
|
||||
showingCachedMessages = true;
|
||||
const status = selectMailUi('#mail-status');
|
||||
if (status) status.textContent = 'Showing saved messages — syncing';
|
||||
}
|
||||
} catch (error) {
|
||||
if (isAndroid && mailFeatureState.syncRequest !== request) return;
|
||||
console.error('Could not load cached messages:', error);
|
||||
}
|
||||
}
|
||||
@@ -734,7 +764,7 @@ async function syncMailbox(showToast, options = {}) {
|
||||
}
|
||||
toastMailUi(error.message || 'Could not sync the inbox');
|
||||
} finally {
|
||||
if (refresh) refresh.disabled = false;
|
||||
if (refresh && (!isAndroid || mailFeatureState.syncRequest === request)) refresh.disabled = false;
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -742,7 +772,9 @@ async function syncMailbox(showToast, options = {}) {
|
||||
try {
|
||||
await sync;
|
||||
} finally {
|
||||
if (mailFeatureState.syncPromise !== sync) return;
|
||||
mailFeatureState.syncPromise = null;
|
||||
mailFeatureState.syncMailboxKey = null;
|
||||
if (mailFeatureState.syncQueued) {
|
||||
mailFeatureState.syncQueued = false;
|
||||
void syncMailbox(false);
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ep-mail",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.16",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ep-mail",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.16",
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^8.5.2",
|
||||
"@capacitor/core": "^8.5.2",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ep-mail",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.16",
|
||||
"private": true,
|
||||
"description": "Eternity Project mail client",
|
||||
"homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client",
|
||||
|
||||
@@ -17,7 +17,7 @@ function deferred() {
|
||||
function harness({ platform = 'android', cached, sync }) {
|
||||
const messages = [];
|
||||
const state = { messages, activeMessage: null, activeFolder: 'Inbox', selectedIds: new Set(), query: '' };
|
||||
const feature = { connectedAccount: { id: 'account' }, pageOffset: 0, syncPromise: null, syncQueued: false };
|
||||
const feature = { connectedAccount: { id: 'account' }, pageOffset: 0, syncPromise: null, syncQueued: false, displayedMailboxKey: JSON.stringify(['account', 'Inbox']) };
|
||||
const elements = new Map();
|
||||
const opened = [];
|
||||
const renders = [];
|
||||
@@ -130,6 +130,76 @@ test('a sync result for a previous folder does not replace the current mailbox',
|
||||
assert.deepEqual(ui.opened, []);
|
||||
});
|
||||
|
||||
test('switching folders shows that folder’s cached messages before the network response', async () => {
|
||||
const network = deferred();
|
||||
const ui = harness({
|
||||
cached: async folder => folder === 'Sent' ? result([42]) : null,
|
||||
sync: () => network.promise
|
||||
});
|
||||
ui.state.messages.push({ id: 1, uid: 1, tags: [] });
|
||||
ui.state.activeFolder = 'Sent';
|
||||
const pending = ui.context.syncMailbox(false, { offset: 0 });
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
assert.deepEqual(ui.state.messages.map(message => message.id), [42]);
|
||||
assert.deepEqual(ui.renders.at(-1), [42]);
|
||||
network.resolve(result([43]));
|
||||
await pending;
|
||||
});
|
||||
|
||||
test('a different folder can load from cache while the previous folder is still syncing', async () => {
|
||||
const inbox = deferred();
|
||||
const sent = deferred();
|
||||
const ui = harness({
|
||||
cached: async folder => folder === 'Sent' ? result([42]) : null,
|
||||
sync: folder => folder === 'Inbox' ? inbox.promise : sent.promise
|
||||
});
|
||||
const first = ui.context.syncMailbox(false);
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
ui.state.activeFolder = 'Sent';
|
||||
const second = ui.context.syncMailbox(false, { offset: 0 });
|
||||
await new Promise(resolve => setImmediate(resolve));
|
||||
assert.deepEqual(ui.state.messages.map(message => message.id), [42]);
|
||||
sent.resolve(result([43]));
|
||||
await second;
|
||||
inbox.resolve(result([1]));
|
||||
await first;
|
||||
assert.deepEqual(ui.state.messages.map(message => message.id), [43]);
|
||||
});
|
||||
|
||||
test('returning to a folder ignores an older request for the same folder', async () => {
|
||||
const firstInbox = deferred();
|
||||
const sent = deferred();
|
||||
const secondInbox = deferred();
|
||||
let calls = 0;
|
||||
const ui = harness({
|
||||
sync: () => [firstInbox, sent, secondInbox][calls++].promise
|
||||
});
|
||||
const first = ui.context.syncMailbox(false);
|
||||
ui.state.activeFolder = 'Sent';
|
||||
const middle = ui.context.syncMailbox(false);
|
||||
ui.state.activeFolder = 'Inbox';
|
||||
const last = ui.context.syncMailbox(false);
|
||||
secondInbox.resolve(result([3]));
|
||||
await last;
|
||||
firstInbox.resolve(result([1]));
|
||||
sent.resolve(result([2]));
|
||||
await Promise.all([first, middle]);
|
||||
assert.deepEqual(ui.state.messages.map(message => message.id), [3]);
|
||||
assert.equal(ui.elements.get('#refresh').disabled, false);
|
||||
});
|
||||
|
||||
test('switching accounts never displays the previous account’s messages', async () => {
|
||||
const network = deferred();
|
||||
const ui = harness({ cached: async () => null, sync: () => network.promise });
|
||||
ui.state.messages.push({ id: 1, uid: 1, tags: [] });
|
||||
ui.feature.connectedAccount = { id: 'other' };
|
||||
const pending = ui.context.syncMailbox(false);
|
||||
assert.equal(ui.state.messages.length, 0);
|
||||
network.resolve(result([2]));
|
||||
await pending;
|
||||
assert.deepEqual(ui.state.messages.map(message => message.id), [2]);
|
||||
});
|
||||
|
||||
test('Android startup theme uses the EP vector on supported splash screens', () => {
|
||||
const styles = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'res', 'values', 'styles.xml'), 'utf8');
|
||||
const icon = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'res', 'drawable', 'ep_splash_icon.xml'), 'utf8');
|
||||
@@ -137,3 +207,15 @@ test('Android startup theme uses the EP vector on supported splash screens', ()
|
||||
assert.match(styles, /name="postSplashScreenTheme">@style\/AppTheme.NoActionBar/);
|
||||
assert.match(icon, /android:strokeColor="#eee9de"/);
|
||||
});
|
||||
|
||||
test('Android launcher icons use the EP logo on adaptive and legacy launchers', () => {
|
||||
const res = path.join(root, 'android', 'app', 'src', 'main', 'res');
|
||||
const read = (...parts) => fs.readFileSync(path.join(res, ...parts), 'utf8');
|
||||
for (const name of ['ic_launcher.xml', 'ic_launcher_round.xml']) {
|
||||
assert.match(read('mipmap-anydpi-v26', name), /@drawable\/ep_launcher_foreground/);
|
||||
assert.match(read('mipmap-anydpi', name), /@drawable\/ep_splash_icon/);
|
||||
}
|
||||
assert.match(read('drawable', 'ep_launcher_foreground.xml'), /@drawable\/ep_splash_icon/);
|
||||
assert.match(read('drawable', 'ep_launcher_foreground.xml'), /android:inset="22dp"/);
|
||||
assert.match(read('values', 'ic_launcher_background.xml'), /#0a0c0b/);
|
||||
});
|
||||
|
||||
+34
-2
@@ -11,6 +11,8 @@ const mailFeatureState = {
|
||||
total: 0,
|
||||
syncPromise: null,
|
||||
syncQueued: false,
|
||||
syncMailboxKey: null,
|
||||
displayedMailboxKey: null,
|
||||
refreshPending: false,
|
||||
folderBeforeSearch: null,
|
||||
customFolders: [],
|
||||
@@ -648,21 +650,41 @@ function setupDraftComposer() {
|
||||
}
|
||||
|
||||
async function syncMailbox(showToast, options = {}) {
|
||||
const isAndroid = window.daybreakMail?.platform === 'android';
|
||||
const mailboxKey = JSON.stringify([mailFeatureState.connectedAccount?.id, rendererState.activeFolder]);
|
||||
if (mailFeatureState.syncPromise) {
|
||||
if (!isAndroid || mailFeatureState.syncMailboxKey === mailboxKey) {
|
||||
mailFeatureState.syncQueued = true;
|
||||
return mailFeatureState.syncPromise;
|
||||
}
|
||||
mailFeatureState.syncQueued = false;
|
||||
}
|
||||
if (!mailFeatureState.connectedAccount || !window.daybreakMail) {
|
||||
openMailAccount();
|
||||
return;
|
||||
}
|
||||
const refresh = selectMailUi('#refresh');
|
||||
if (refresh) refresh.disabled = true;
|
||||
const request = {};
|
||||
mailFeatureState.syncRequest = request;
|
||||
mailFeatureState.syncMailboxKey = mailboxKey;
|
||||
const sync = (async () => {
|
||||
let showingCachedMessages = false;
|
||||
try {
|
||||
if (isAndroid && mailFeatureState.displayedMailboxKey !== mailboxKey) {
|
||||
mailFeatureState.displayedMailboxKey = mailboxKey;
|
||||
rendererState.messages.splice(0, rendererState.messages.length);
|
||||
rendererState.activeMessage = null;
|
||||
rendererState.selectedIds.clear();
|
||||
document.body.classList.remove('reader-open');
|
||||
selectMailUi('#reader-pane').innerHTML = appShell.emptyReader();
|
||||
appShell.renderList();
|
||||
const status = selectMailUi('#mail-status');
|
||||
if (status) status.textContent = 'Loading folder…';
|
||||
}
|
||||
if (rendererState.activeFolder === 'Drafts') {
|
||||
const result = await window.daybreakMail.listDrafts();
|
||||
if (isAndroid && mailFeatureState.syncRequest !== request) return;
|
||||
renderDrafts(result.drafts || []);
|
||||
if (showToast) toastMailUi(`${result.drafts.length} saved drafts`);
|
||||
return;
|
||||
@@ -671,19 +693,27 @@ async function syncMailbox(showToast, options = {}) {
|
||||
const accountId = mailFeatureState.connectedAccount.id;
|
||||
const offset = options.offset ?? (options.append ? mailFeatureState.pageOffset + rendererState.messages.length : mailFeatureState.pageOffset);
|
||||
const filters = mailSearchFilters();
|
||||
const isCurrentMailbox = () => rendererState.activeFolder === folder && mailFeatureState.connectedAccount?.id === accountId;
|
||||
const isCurrentMailbox = () => rendererState.activeFolder === folder && mailFeatureState.connectedAccount?.id === accountId &&
|
||||
(!isAndroid || mailFeatureState.syncRequest === request);
|
||||
if (window.daybreakMail.getCachedFolder && !options.append && offset === 0 && !rendererState.messages.length) {
|
||||
try {
|
||||
const cached = await window.daybreakMail.getCachedFolder(folder, offset, filters);
|
||||
if (cached && isCurrentMailbox()) {
|
||||
rendererState.messages.splice(0, rendererState.messages.length, ...cached.messages);
|
||||
rendererState.activeMessage = null;
|
||||
mailFeatureState.pageOffset = offset;
|
||||
mailFeatureState.total = cached.total;
|
||||
const pagination = selectMailUi('#pagination');
|
||||
if (pagination) pagination.textContent = cached.total ? `${cached.start}–${cached.end} of ${cached.total} saved messages` : '0 saved messages';
|
||||
const loadMore = selectMailUi('#load-more');
|
||||
if (loadMore) loadMore.classList.toggle('hidden', cached.messages.length >= cached.total);
|
||||
appShell.renderList();
|
||||
showingCachedMessages = true;
|
||||
const status = selectMailUi('#mail-status');
|
||||
if (status) status.textContent = 'Showing saved messages — syncing';
|
||||
}
|
||||
} catch (error) {
|
||||
if (isAndroid && mailFeatureState.syncRequest !== request) return;
|
||||
console.error('Could not load cached messages:', error);
|
||||
}
|
||||
}
|
||||
@@ -734,7 +764,7 @@ async function syncMailbox(showToast, options = {}) {
|
||||
}
|
||||
toastMailUi(error.message || 'Could not sync the inbox');
|
||||
} finally {
|
||||
if (refresh) refresh.disabled = false;
|
||||
if (refresh && (!isAndroid || mailFeatureState.syncRequest === request)) refresh.disabled = false;
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -742,7 +772,9 @@ async function syncMailbox(showToast, options = {}) {
|
||||
try {
|
||||
await sync;
|
||||
} finally {
|
||||
if (mailFeatureState.syncPromise !== sync) return;
|
||||
mailFeatureState.syncPromise = null;
|
||||
mailFeatureState.syncMailboxKey = null;
|
||||
if (mailFeatureState.syncQueued) {
|
||||
mailFeatureState.syncQueued = false;
|
||||
void syncMailbox(false);
|
||||
|
||||
Reference in New Issue
Block a user