Fix race condition when updating discoveredCount
This commit is contained in:
parent
c071798b02
commit
24d08a69e9
@ -57,8 +57,9 @@ class CollectiblesLogic with ThrottledSaveLoadMixin {
|
|||||||
if (state == CollectibleState.discovered) _discoveredCount++;
|
if (state == CollectibleState.discovered) _discoveredCount++;
|
||||||
if (state == CollectibleState.explored) _exploredCount++;
|
if (state == CollectibleState.explored) _exploredCount++;
|
||||||
});
|
});
|
||||||
HomeWidget.saveWidgetData<int>('discoveredCount', _discoveredCount);
|
HomeWidget.saveWidgetData<int>('discoveredCount', _discoveredCount).then((value){
|
||||||
HomeWidget.updateWidget(iOSName: _appName);
|
HomeWidget.updateWidget(iOSName: _appName);
|
||||||
|
});
|
||||||
debugPrint('setting discovered count for home widget $_discoveredCount');
|
debugPrint('setting discovered count for home widget $_discoveredCount');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user