Skip to content

Commit

Permalink
Merge pull request #3693 from tloncorp/promote-dev-latest
Browse files Browse the repository at this point in the history
ops: promote dev to latest
  • Loading branch information
arthyn authored Jun 28, 2024
2 parents 192f520 + 59b9041 commit 5d72c9e
Show file tree
Hide file tree
Showing 54 changed files with 1,306 additions and 336 deletions.
1 change: 1 addition & 0 deletions apps/tlon-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"
apply plugin: "com.google.firebase.crashlytics"
apply plugin: 'com.google.firebase.firebase-perf'

def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()

Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ buildscript {
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('com.google.firebase:firebase-crashlytics-gradle:2.9.9')
}
classpath('com.google.firebase:perf-plugin:1.4.2')
}
}

apply plugin: "com.facebook.react.rootproject"
Expand Down
62 changes: 32 additions & 30 deletions apps/tlon-mobile/cosmos.imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
import { RendererConfig, UserModuleWrappers } from 'react-cosmos-core';

import * as fixture0 from './src/App.fixture';
import * as fixture30 from './src/fixtures/ActionSheet.fixture';
import * as fixture29 from './src/fixtures/AudioEmbed.fixture';
import * as fixture28 from './src/fixtures/BlockSectionList.fixture';
import * as fixture27 from './src/fixtures/Button.fixture';
import * as fixture26 from './src/fixtures/Channel.fixture';
import * as fixture25 from './src/fixtures/ChannelDivider.fixture';
import * as fixture24 from './src/fixtures/ChannelHeader.fixture';
import * as fixture23 from './src/fixtures/ChannelSwitcherSheet.fixture';
import * as fixture22 from './src/fixtures/ChatMessage.fixture';
import * as fixture21 from './src/fixtures/ChatReference.fixture';
import * as fixture20 from './src/fixtures/ContactList.fixture';
import * as fixture19 from './src/fixtures/DetailView.fixture';
import * as fixture18 from './src/fixtures/GalleryPost.fixture';
import * as fixture17 from './src/fixtures/GroupList.fixture';
import * as fixture16 from './src/fixtures/GroupListItem.fixture';
import * as fixture31 from './src/fixtures/ActionSheet.fixture';
import * as fixture30 from './src/fixtures/AudioEmbed.fixture';
import * as fixture29 from './src/fixtures/BlockSectionList.fixture';
import * as fixture28 from './src/fixtures/Button.fixture';
import * as fixture27 from './src/fixtures/Channel.fixture';
import * as fixture26 from './src/fixtures/ChannelDivider.fixture';
import * as fixture25 from './src/fixtures/ChannelHeader.fixture';
import * as fixture24 from './src/fixtures/ChannelSwitcherSheet.fixture';
import * as fixture23 from './src/fixtures/ChatMessage.fixture';
import * as fixture22 from './src/fixtures/ChatReference.fixture';
import * as fixture21 from './src/fixtures/ContactList.fixture';
import * as fixture20 from './src/fixtures/DetailView.fixture';
import * as fixture19 from './src/fixtures/GalleryPost.fixture';
import * as fixture18 from './src/fixtures/GroupList.fixture';
import * as fixture17 from './src/fixtures/GroupListItem.fixture';
import * as fixture16 from './src/fixtures/GroupMetaScreen.fixture';
import * as fixture15 from './src/fixtures/HeaderButton.fixture';
import * as fixture14 from './src/fixtures/ImageViewer.fixture';
import * as fixture13 from './src/fixtures/Input.fixture';
Expand Down Expand Up @@ -57,21 +58,22 @@ const fixtures = {
'src/fixtures/Input.fixture.tsx': { module: fixture13 },
'src/fixtures/ImageViewer.fixture.tsx': { module: fixture14 },
'src/fixtures/HeaderButton.fixture.tsx': { module: fixture15 },
'src/fixtures/GroupListItem.fixture.tsx': { module: fixture16 },
'src/fixtures/GroupList.fixture.tsx': { module: fixture17 },
'src/fixtures/GalleryPost.fixture.tsx': { module: fixture18 },
'src/fixtures/DetailView.fixture.tsx': { module: fixture19 },
'src/fixtures/ContactList.fixture.tsx': { module: fixture20 },
'src/fixtures/ChatReference.fixture.tsx': { module: fixture21 },
'src/fixtures/ChatMessage.fixture.tsx': { module: fixture22 },
'src/fixtures/ChannelSwitcherSheet.fixture.tsx': { module: fixture23 },
'src/fixtures/ChannelHeader.fixture.tsx': { module: fixture24 },
'src/fixtures/ChannelDivider.fixture.tsx': { module: fixture25 },
'src/fixtures/Channel.fixture.tsx': { module: fixture26 },
'src/fixtures/Button.fixture.tsx': { module: fixture27 },
'src/fixtures/BlockSectionList.fixture.tsx': { module: fixture28 },
'src/fixtures/AudioEmbed.fixture.tsx': { module: fixture29 },
'src/fixtures/ActionSheet.fixture.tsx': { module: fixture30 },
'src/fixtures/GroupMetaScreen.fixture.tsx': { module: fixture16 },
'src/fixtures/GroupListItem.fixture.tsx': { module: fixture17 },
'src/fixtures/GroupList.fixture.tsx': { module: fixture18 },
'src/fixtures/GalleryPost.fixture.tsx': { module: fixture19 },
'src/fixtures/DetailView.fixture.tsx': { module: fixture20 },
'src/fixtures/ContactList.fixture.tsx': { module: fixture21 },
'src/fixtures/ChatReference.fixture.tsx': { module: fixture22 },
'src/fixtures/ChatMessage.fixture.tsx': { module: fixture23 },
'src/fixtures/ChannelSwitcherSheet.fixture.tsx': { module: fixture24 },
'src/fixtures/ChannelHeader.fixture.tsx': { module: fixture25 },
'src/fixtures/ChannelDivider.fixture.tsx': { module: fixture26 },
'src/fixtures/Channel.fixture.tsx': { module: fixture27 },
'src/fixtures/Button.fixture.tsx': { module: fixture28 },
'src/fixtures/BlockSectionList.fixture.tsx': { module: fixture29 },
'src/fixtures/AudioEmbed.fixture.tsx': { module: fixture30 },
'src/fixtures/ActionSheet.fixture.tsx': { module: fixture31 },
};

const decorators = {
Expand Down
8 changes: 8 additions & 0 deletions apps/tlon-mobile/ios/Landscape.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,13 @@
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXUpdates/EXUpdates.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting/FirebaseABTesting_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreExtension/FirebaseCoreExtension_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreInternal/FirebaseCoreInternal_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics/FirebaseCrashlytics_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
Expand All @@ -705,11 +707,13 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXUpdates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseABTesting_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCore_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreExtension_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreInternal_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCrashlytics_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseInstallations_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseRemoteConfig_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
Expand Down Expand Up @@ -788,11 +792,13 @@
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXUpdates/EXUpdates.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseABTesting/FirebaseABTesting_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreExtension/FirebaseCoreExtension_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreInternal/FirebaseCoreInternal_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCrashlytics/FirebaseCrashlytics_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseRemoteConfig/FirebaseRemoteConfig_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
Expand All @@ -807,11 +813,13 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXUpdates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseABTesting_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCore_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreExtension_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreInternal_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCrashlytics_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseInstallations_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseRemoteConfig_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
Expand Down
45 changes: 45 additions & 0 deletions apps/tlon-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ PODS:
- Firebase/Crashlytics (10.24.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 10.24.0)
- Firebase/Performance (10.24.0):
- Firebase/CoreOnly
- FirebasePerformance (~> 10.24.0)
- FirebaseABTesting (10.28.0):
- FirebaseCore (~> 10.0)
- FirebaseCore (10.24.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
Expand All @@ -182,6 +187,24 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebasePerformance (10.24.0):
- FirebaseCore (~> 10.5)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfig (~> 10.0)
- FirebaseSessions (~> 10.5)
- GoogleDataTransport (~> 9.2)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/ISASwizzler (~> 7.8)
- GoogleUtilities/MethodSwizzler (~> 7.8)
- nanopb (< 2.30911.0, >= 2.30908.0)
- FirebaseRemoteConfig (10.28.0):
- FirebaseABTesting (~> 10.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfigInterop (~> 10.23)
- FirebaseSharedSwift (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseRemoteConfigInterop (10.24.0)
- FirebaseSessions (10.24.0):
- FirebaseCore (~> 10.5)
Expand All @@ -191,6 +214,7 @@ PODS:
- GoogleUtilities/Environment (~> 7.10)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- FirebaseSharedSwift (10.28.0)
- fmt (6.2.1)
- glog (0.3.5)
- GoogleDataTransport (9.4.1):
Expand All @@ -200,9 +224,14 @@ PODS:
- GoogleUtilities/Environment (7.13.0):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/ISASwizzler (7.13.0):
- GoogleUtilities/Privacy
- GoogleUtilities/Logger (7.13.0):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/MethodSwizzler (7.13.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- "GoogleUtilities/NSData+zlib (7.13.0)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.0)
Expand Down Expand Up @@ -1320,6 +1349,10 @@ PODS:
- FirebaseCoreExtension
- React-Core
- RNFBApp
- RNFBPerf (19.2.2):
- Firebase/Performance (= 10.24.0)
- React-Core
- RNFBApp
- RNGestureHandler (2.14.1):
- glog
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -1453,6 +1486,7 @@ DEPENDENCIES:
- RNDeviceInfo (from `../../../node_modules/react-native-device-info`)
- "RNFBApp (from `../../../node_modules/@react-native-firebase/app`)"
- "RNFBCrashlytics (from `../../../node_modules/@react-native-firebase/crashlytics`)"
- "RNFBPerf (from `../../../node_modules/@react-native-firebase/perf`)"
- RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`)
- RNReanimated (from `../../../node_modules/react-native-reanimated`)
- RNScreens (from `../../../node_modules/react-native-screens`)
Expand All @@ -1465,13 +1499,17 @@ SPEC REPOS:
trunk:
- BranchSDK
- Firebase
- FirebaseABTesting
- FirebaseCore
- FirebaseCoreExtension
- FirebaseCoreInternal
- FirebaseCrashlytics
- FirebaseInstallations
- FirebasePerformance
- FirebaseRemoteConfig
- FirebaseRemoteConfigInterop
- FirebaseSessions
- FirebaseSharedSwift
- fmt
- GoogleDataTransport
- GoogleUtilities
Expand Down Expand Up @@ -1679,6 +1717,8 @@ EXTERNAL SOURCES:
:path: "../../../node_modules/@react-native-firebase/app"
RNFBCrashlytics:
:path: "../../../node_modules/@react-native-firebase/crashlytics"
RNFBPerf:
:path: "../../../node_modules/@react-native-firebase/perf"
RNGestureHandler:
:path: "../../../node_modules/react-native-gesture-handler"
RNReanimated:
Expand Down Expand Up @@ -1733,13 +1773,17 @@ SPEC CHECKSUMS:
FBLazyVector: 84f6edbe225f38aebd9deaf1540a4160b1f087d7
FBReactNativeSpec: 4b31c1954525bc2e3a5df4cbbd06fc7ae9191b11
Firebase: 91fefd38712feb9186ea8996af6cbdef41473442
FirebaseABTesting: 589bc28c0ab3e5554336895a34aa262e24276665
FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894
FirebaseCoreExtension: af5fd85e817ea9d19f9a2659a376cf9cf99f03c0
FirebaseCoreInternal: bcb5acffd4ea05e12a783ecf835f2210ce3dc6af
FirebaseCrashlytics: af38ea4adfa606f6e63fcc22091b61e7938fcf66
FirebaseInstallations: 8f581fca6478a50705d2bd2abd66d306e0f5736e
FirebasePerformance: 78fed7cf7907f67af3c1e9667d2d1881765f11e2
FirebaseRemoteConfig: f0879a8dccf4e8905716ed849569130efaeab3e2
FirebaseRemoteConfigInterop: 6c349a466490aeace3ce9c091c86be1730711634
FirebaseSessions: 2651b464e241c93fd44112f995d5ab663c970487
FirebaseSharedSwift: 48de4aec81a6b79bb30404e5e6db43ea74848fed
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
Expand Down Expand Up @@ -1810,6 +1854,7 @@ SPEC CHECKSUMS:
RNDeviceInfo: db5c64a060e66e5db3102d041ebe3ef307a85120
RNFBApp: 614f1621b49db54ebd258df8c45427370d8d84a2
RNFBCrashlytics: c39e903af97cb426f36a10d3268fb0623a1ccddf
RNFBPerf: 91a69c5e9c3cefb51928eecc3eff76c616fcbafe
RNGestureHandler: 28bdf9a766c081e603120f79e925b72817c751c6
RNReanimated: fb34efce9255966f5d71bd0fc65e14042c4b88a9
RNScreens: 2b73f5eb2ac5d94fbd61fa4be0bfebd345716825
Expand Down
1 change: 1 addition & 0 deletions apps/tlon-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@react-native-community/netinfo": "11.1.0",
"@react-native-firebase/app": "^19.2.2",
"@react-native-firebase/crashlytics": "^19.2.2",
"@react-native-firebase/perf": "^19.2.2",
"@react-navigation/bottom-tabs": "^6.5.12",
"@react-navigation/native": "^6.1.7",
"@react-navigation/native-stack": "^6.9.13",
Expand Down
1 change: 1 addition & 0 deletions apps/tlon-mobile/src/App.main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useAsyncStorageDevTools } from '@dev-plugins/async-storage';
import { useReactNavigationDevTools } from '@dev-plugins/react-navigation';
import { useReactQueryDevTools } from '@dev-plugins/react-query';
import NetInfo from '@react-native-community/netinfo';
import perf from '@react-native-firebase/perf';
import {
DarkTheme,
DefaultTheme,
Expand Down
27 changes: 27 additions & 0 deletions apps/tlon-mobile/src/fixtures/GroupMetaScreen.fixture.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { GroupMetaScreenView } from '@tloncorp/ui';

import { FixtureWrapper } from './FixtureWrapper';
import { group } from './fakeData';

const GroupMetaScreenFixture = () => {
return (
<FixtureWrapper>
<GroupMetaScreenView
group={group}
currentUserIsAdmin={true}
deleteGroup={() => console.log('deleteGroup')}
goBack={() => console.log('goBack')}
setGroupMetadata={() => console.log('setGroupMetadata')}
uploadInfo={{
imageAttachment: null,
setAttachments: () => console.log('setAttachments'),
resetImageAttachment: () => console.log('resetImageAttachment'),
canUpload: true,
uploading: false,
}}
/>
</FixtureWrapper>
);
};

export default GroupMetaScreenFixture;
11 changes: 11 additions & 0 deletions apps/tlon-mobile/src/hooks/useImageUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ export function useImageUpload(props: UploadParams): UploadInfo {
uploader?.clear();
}, [uploader]);

useEffect(() => {
// if the most recent file is null, but we have an uploaded image, it means
// that the image was successfully uploaded and we should reset the state
// This is a bit of a hack to get around the fact that
// some race condition can cause the uploadedImage to stick around after
// resetImageAttachment is called from a consumer of the hook
if (mostRecentFile === null && uploadedImage !== null) {
resetImageAttachment();
}
}, [mostRecentFile, uploadedImage, resetImageAttachment]);

useEffect(() => {
const getResizedImage = async (uri: string) => {
const manipulated = await resizeImage(uri);
Expand Down
15 changes: 15 additions & 0 deletions apps/tlon-mobile/src/screens/ChannelScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ export default function ChannelScreen(props: ChannelScreenProps) {
uploaderKey: `${currentChannelId}`,
});

const session = store.useCurrentSession();
const hasCachedNewest = useMemo(() => {
if (!session || !channel) {
return false;
}
const { syncedAt, lastPostAt } = channel;
if (syncedAt && session.startTime < syncedAt) {
return true;
} else if (lastPostAt && syncedAt && syncedAt > lastPostAt) {
return true;
}
return false;
}, [channel, session]);

const selectedPostId = props.route.params.selectedPostId;
const cursor = useMemo(() => {
if (!channel) {
Expand All @@ -81,6 +95,7 @@ export default function ChannelScreen(props: ChannelScreenProps) {
enabled: !!channel,
channelId: currentChannelId,
count: 50,
hasCachedNewest,
...(cursor
? {
mode: 'around',
Expand Down
Loading

0 comments on commit 5d72c9e

Please sign in to comment.