mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 16:22:39 +00:00
Console: BugFix in Settings - Restore correctly user's display name after cache clearing.
This commit is contained in:
parent
23f80689ff
commit
b810d71c89
4 changed files with 10 additions and 5 deletions
|
@ -22,7 +22,7 @@ typedef enum : NSUInteger {
|
|||
MatrixSDKHandlerStatusLoggedOut = 0,
|
||||
MatrixSDKHandlerStatusLogged,
|
||||
MatrixSDKHandlerStatusStoreDataReady,
|
||||
MatrixSDKHandlerStatusServerSyncInProgress,
|
||||
MatrixSDKHandlerStatusInitialServerSyncInProgress,
|
||||
MatrixSDKHandlerStatusServerSyncDone,
|
||||
MatrixSDKHandlerStatusPaused
|
||||
} MatrixSDKHandlerStatus;
|
||||
|
|
|
@ -186,7 +186,7 @@ static MatrixSDKHandler *sharedHandler = nil;
|
|||
}
|
||||
|
||||
// Launch mxSession
|
||||
self.status = MatrixSDKHandlerStatusServerSyncInProgress;
|
||||
self.status = MatrixSDKHandlerStatusInitialServerSyncInProgress;
|
||||
[self.mxSession start:^{
|
||||
self.status = MatrixSDKHandlerStatusServerSyncDone;
|
||||
[self setUserPresence:MXPresenceOnline andStatusMessage:nil completion:nil];
|
||||
|
@ -458,7 +458,7 @@ static MatrixSDKHandler *sharedHandler = nil;
|
|||
break;
|
||||
}
|
||||
case MatrixSDKHandlerStatusLogged:
|
||||
case MatrixSDKHandlerStatusServerSyncInProgress: {
|
||||
case MatrixSDKHandlerStatusInitialServerSyncInProgress: {
|
||||
self.isActivityInProgress = YES;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
|
||||
if (mxHandler.mxSession) {
|
||||
// Check matrix handler status
|
||||
if (mxHandler.status == MatrixSDKHandlerStatusStoreDataReady || mxHandler.status == MatrixSDKHandlerStatusServerSyncInProgress) {
|
||||
if (mxHandler.status == MatrixSDKHandlerStatusStoreDataReady || mxHandler.status == MatrixSDKHandlerStatusInitialServerSyncInProgress) {
|
||||
// Server sync is not complete yet
|
||||
if (!recents) {
|
||||
// Retrieve recents from local storage (some data may not be up-to-date)
|
||||
|
|
|
@ -350,7 +350,12 @@ NSString* const kCommandsDescriptionText = @"The following commands are availabl
|
|||
// TODO display user's presence
|
||||
}];
|
||||
}
|
||||
} else if (mxHandler.status == MatrixSDKHandlerStatusStoreDataReady || mxHandler.status == MatrixSDKHandlerStatusServerSyncInProgress) {
|
||||
} else if (mxHandler.status == MatrixSDKHandlerStatusStoreDataReady || mxHandler.status == MatrixSDKHandlerStatusInitialServerSyncInProgress) {
|
||||
// Remove listener (if any), this action is required to handle correctly matrix sdk handler reload (see clear cache)
|
||||
if (userUpdateListener) {
|
||||
[mxHandler.mxSession.myUser removeListener:userUpdateListener];
|
||||
userUpdateListener = nil;
|
||||
}
|
||||
// Set local user's information (the data may not be up-to-date)
|
||||
[self updateUserPicture:mxHandler.mxSession.myUser.avatarUrl force:NO];
|
||||
currentDisplayName = mxHandler.mxSession.myUser.displayname;
|
||||
|
|
Loading…
Reference in a new issue