[ios] Update UI after synchronization finished

This commit is contained in:
VladiMihaylenko 2018-05-15 13:12:29 +03:00 committed by Aleksandr Zatsepin
parent fdba846006
commit 1a86eb4440
3 changed files with 4 additions and 7 deletions

View file

@ -252,7 +252,7 @@ extension BMCDefaultViewModel: MWMBookmarksObserver {
filesPrepared = true
}
func onRestoringFinished(_ result: MWMSynchronizationResult) {
func onSynchronizationFinished(_ result: MWMSynchronizationResult) {
MWMAlertViewController.activeAlert().closeAlert() { [weak self] in
switch result {
case .networkError: fallthrough

View file

@ -161,12 +161,9 @@ NSString * const CloudErrorToString(Cloud::SynchronizationResult result)
withParameters:@{kStatType: error, kStatError: @(errorStr.c_str())}];
}
if (type != Cloud::SynchronizationType::Restore)
return;
[[MWMBookmarksManager manager] loopObservers:^(Observer observer) {
if ([observer respondsToSelector:@selector(onRestoringFinished:)])
[observer onRestoringFinished:static_cast<MWMSynchronizationResult>(my::Key(result))];
if ([observer respondsToSelector:@selector(onSynchronizationFinished:)])
[observer onSynchronizationFinished:static_cast<MWMSynchronizationResult>(my::Key(result))];
}];
};

View file

@ -24,7 +24,7 @@ typedef NS_ENUM(NSUInteger, MWMSynchronizationResult)
@optional
- (void)onRestoringRequest:(MWMRestoringRequestResult)result backupDate:(NSDate * _Nullable)date;
- (void)onRestoringFinished:(MWMSynchronizationResult)result;
- (void)onSynchronizationFinished:(MWMSynchronizationResult)result;
- (void)onRestoringStarted;
- (void)onRestoringFilesPrepared;
- (void)onBookmarksLoadFinished;