Fixes a race condition when initializing the calendar-event field

The problem was that the field executes a request to validate its
state. This was initiated at the same time for two values. Then it was
undetermined which value comes back first.
This commit is contained in:
Eike Kettner
2020-08-01 11:07:18 +02:00
parent f95f01759b
commit b4e11a7264
3 changed files with 10 additions and 6 deletions

View File

@@ -136,8 +136,8 @@ init flags =
initialSchedule =
Data.Validated.Unknown Data.CalEvent.everyMonth
( sm, sc ) =
Comp.CalEventInput.init flags Data.CalEvent.everyMonth
sm =
Comp.CalEventInput.initDefault
in
( { settings = Api.Model.ScanMailboxSettings.empty
, connectionModel =
@@ -168,7 +168,6 @@ init flags =
}
, Cmd.batch
[ Api.getImapSettings flags "" ConnResp
, Cmd.map CalEventMsg sc
, Api.getFolders flags "" False GetFolderResp
]
)