fix: do not resync IMAP after initial configuration

If there was no previous `configured_addr`,
then there is no need to run IMAP resync.
This commit is contained in:
link2xt
2023-07-17 09:03:59 +00:00
parent c14f45a8f5
commit 740f43a2d6
3 changed files with 6 additions and 14 deletions

View File

@@ -462,9 +462,12 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> {
progress!(ctx, 910);
if ctx.get_config(Config::ConfiguredAddr).await?.as_deref() != Some(&param.addr) {
// Switched account, all server UIDs we know are invalid
job::schedule_resync(ctx).await?;
if let Some(configured_addr) = ctx.get_config(Config::ConfiguredAddr).await? {
if configured_addr != param.addr {
// Switched account, all server UIDs we know are invalid
info!(ctx, "Scheduling resync because the address has changed.");
job::schedule_resync(ctx).await?;
}
}
// the trailing underscore is correct