From 73f5bc20eb5ef46286e6350acf3fb1bec1bd361d Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Mon, 22 Jun 2020 15:24:54 -0700 Subject: [PATCH] Various fixes: (#4465) * Dispatch REHYDRATED if already hydrated after getStoredState call * Empty/null prev version is valid * Update iOS target to 11.0 --- app/mm-redux/selectors/entities/channels.ts | 2 +- app/store/index.ts | 2 ++ app/utils/general.js | 2 +- ios/Mattermost.xcodeproj/project.pbxproj | 12 ++++++------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/mm-redux/selectors/entities/channels.ts b/app/mm-redux/selectors/entities/channels.ts index c11eebb33..8708080bb 100644 --- a/app/mm-redux/selectors/entities/channels.ts +++ b/app/mm-redux/selectors/entities/channels.ts @@ -885,7 +885,7 @@ export const getDefaultChannelForTeams: (a: GlobalState) => RelationOneToOne RelationOneToOne = createSelector(getAllChannels, getMyChannelMemberships, getMyTeams, getCurrentUser, (allChannels: IDMappedObjects, myChannelMemberships: RelationOneToOne, myTeams: Array, currentUser: UserProfile): RelationOneToOne => { - const locale = currentUser.locale || General.DEFAULT_LOCALE; + const locale = currentUser?.locale || General.DEFAULT_LOCALE; const result: RelationOneToOne = {}; for (const team of myTeams) { diff --git a/app/store/index.ts b/app/store/index.ts index 66149e397..07524a0af 100644 --- a/app/store/index.ts +++ b/app/store/index.ts @@ -240,6 +240,8 @@ export default function configureStore(storage: any, preloadedState: any = {}, o }); store.dispatch({type: General.REHYDRATED}); AsyncStorage.multiRemove(storeKeys); + } else if (store.getState()._persist?.rehydrated) { // eslint-disable-line no-underscore-dangle + store.dispatch({type: General.REHYDRATED}); } else { let executed = false; const unsubscribe = store.subscribe(() => { diff --git a/app/utils/general.js b/app/utils/general.js index 1647f8331..cb8f6fd6e 100644 --- a/app/utils/general.js +++ b/app/utils/general.js @@ -90,7 +90,7 @@ export function validatePreviousVersion(previousVersion) { INVALID_VERSIONS.push('1.31.0', '1.31.1'); } - if (!previousVersion || INVALID_VERSIONS.includes(previousVersion)) { + if (INVALID_VERSIONS.includes(previousVersion)) { return false; } diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index f61a10cd9..97e0ac8af 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -945,7 +945,7 @@ "$(SRCROOT)/UploadAttachments/UploadAttachments", ); INFOPLIST_FILE = Mattermost/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_CFLAGS = ( "$(inherited)", @@ -987,7 +987,7 @@ "$(SRCROOT)/UploadAttachments/UploadAttachments", ); INFOPLIST_FILE = Mattermost/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_CFLAGS = ( "$(inherited)", @@ -1035,7 +1035,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "$(SRCROOT)/UploadAttachments/UploadAttachments"; INFOPLIST_FILE = MattermostShare/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -1081,7 +1081,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "$(SRCROOT)/UploadAttachments/UploadAttachments"; INFOPLIST_FILE = MattermostShare/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; MTL_FAST_MATH = YES; OTHER_CFLAGS = ( @@ -1123,7 +1123,7 @@ DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = NotificationService/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -1167,7 +1167,7 @@ DEVELOPMENT_TEAM = UQ8HT4Q2XM; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = NotificationService/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; MTL_FAST_MATH = YES; OTHER_CFLAGS = (