mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 13:33:32 +00:00
Fix updates timer should only be configured once per profile and do nothing if not the active one
This commit is contained in:
parent
e5f06f650a
commit
fbf95350e4
1 changed files with 5 additions and 1 deletions
|
@ -29,11 +29,15 @@ Future<void> executeUpdatesForProfile(Profile profile) async {
|
|||
return;
|
||||
}
|
||||
|
||||
if (getIt<AccountsService>().currentProfile != profile) {
|
||||
return;
|
||||
}
|
||||
|
||||
await getIt<ActiveProfileSelector<PersistentInfoService>>()
|
||||
.getForProfile(profile)
|
||||
.withResultAsync((info) async {
|
||||
final dt = DateTime.now().difference(info.lastMyConnectionsUpdate);
|
||||
_logger.finer('Time since last connections update: $dt');
|
||||
_logger.finer('Time since last update for ${profile.id}: $dt');
|
||||
if (dt >= _connectionsRefreshInterval) {
|
||||
await getIt<ActiveProfileSelector<ConnectionsManager>>()
|
||||
.getForProfile(profile)
|
||||
|
|
Loading…
Reference in a new issue