diff --git a/android/app/build.gradle b/android/app/build.gradle index 689f44677d..b191b7b3a7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -147,7 +147,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode VERSIONCODE as Integer - versionName "4.49.1" + versionName "4.49.2" vectorDrawables.useSupportLibrary = true if (!isFoss) { manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String] diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0aaad5adc9..3ea603b644 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -79,4 +79,11 @@ + + + + + + + diff --git a/app/containers/Toast.tsx b/app/containers/Toast.tsx index cd538734c0..781ad5b59e 100644 --- a/app/containers/Toast.tsx +++ b/app/containers/Toast.tsx @@ -13,9 +13,8 @@ const styles = StyleSheet.create({ }, text: { fontSize: 14, - // jest error: TypeError: Cannot read property 'textRegular' of undefined - ...sharedStyles?.textRegular, - ...sharedStyles?.textAlignCenter + ...sharedStyles.textRegular, + ...sharedStyles.textAlignCenter } }); diff --git a/app/lib/methods/subscriptions/room.ts b/app/lib/methods/subscriptions/room.ts index 7810258dbc..7564477027 100644 --- a/app/lib/methods/subscriptions/room.ts +++ b/app/lib/methods/subscriptions/room.ts @@ -19,6 +19,7 @@ import { IDDPMessage } from '../../../definitions/IDDPMessage'; import sdk from '../../services/sdk'; import { readMessages } from '../readMessages'; import { loadMissedMessages } from '../loadMissedMessages'; +import { updateLastOpen } from '../updateLastOpen'; const WINDOW_TIME = 1000; @@ -74,7 +75,7 @@ export default class RoomSubscription { unsubscribe = async () => { console.log(`[RCRN] Unsubscribing from room ${this.rid}`); - readMessages(this.rid, new Date(), true).catch(e => console.log(e)); + updateLastOpen(this.rid); this.isAlive = false; reduxStore.dispatch(unsubscribeRoom(this.rid)); if (this.promises) { diff --git a/app/lib/methods/updateLastOpen.ts b/app/lib/methods/updateLastOpen.ts new file mode 100644 index 0000000000..2aec8eb4cc --- /dev/null +++ b/app/lib/methods/updateLastOpen.ts @@ -0,0 +1,17 @@ +import database from '../database'; +import log from './helpers/log'; +import { TSubscriptionModel } from '../../definitions'; + +export async function updateLastOpen(rid: string, lastOpen = new Date()): Promise { + try { + const db = database.active; + const subscription = await db.get('subscriptions').find(rid); + await db.write(async () => { + await subscription.update((s: TSubscriptionModel) => { + s.lastOpen = lastOpen; + }); + }); + } catch (e) { + log(e); + } +} diff --git a/app/views/Styles.ts b/app/views/Styles.ts index dd7c9864b1..d66706db09 100644 --- a/app/views/Styles.ts +++ b/app/views/Styles.ts @@ -1,6 +1,6 @@ import { Platform, StyleSheet, TextStyle } from 'react-native'; -import { MAX_SCREEN_CONTENT_WIDTH } from '../lib/constants'; +import { MAX_SCREEN_CONTENT_WIDTH } from '../lib/constants/tablet'; const defaultTextStyle: TextStyle = { textAlign: 'left', diff --git a/ios/RocketChatRN.xcodeproj/project.pbxproj b/ios/RocketChatRN.xcodeproj/project.pbxproj index d3aefa79f6..ef57a110cf 100644 --- a/ios/RocketChatRN.xcodeproj/project.pbxproj +++ b/ios/RocketChatRN.xcodeproj/project.pbxproj @@ -2910,7 +2910,7 @@ INFOPLIST_FILE = NotificationService/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 4.49.1; + MARKETING_VERSION = 4.49.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; @@ -2950,7 +2950,7 @@ INFOPLIST_FILE = NotificationService/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 4.49.1; + MARKETING_VERSION = 4.49.2; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService; diff --git a/ios/RocketChatRN/Info.plist b/ios/RocketChatRN/Info.plist index 454f1fa6e8..301304c525 100644 --- a/ios/RocketChatRN/Info.plist +++ b/ios/RocketChatRN/Info.plist @@ -26,7 +26,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.49.1 + 4.49.2 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/ShareRocketChatRN/Info.plist b/ios/ShareRocketChatRN/Info.plist index ac9590cff2..12c6e7a89a 100644 --- a/ios/ShareRocketChatRN/Info.plist +++ b/ios/ShareRocketChatRN/Info.plist @@ -26,7 +26,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 4.49.1 + 4.49.2 CFBundleVersion 1 KeychainGroup diff --git a/package.json b/package.json index a83f939e68..22c3d7dfdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket-chat-reactnative", - "version": "4.49.1", + "version": "4.49.2", "private": true, "scripts": { "start": "react-native start",