@planningcenter/chat-react-native 4.2.1-qa-staging.7 → 4.2.1-qa-staging.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/build/components/conversation/message_form.d.ts +1 -1
  2. package/build/components/conversation/message_form.d.ts.map +1 -1
  3. package/build/components/conversation/message_form.js +167 -373
  4. package/build/components/conversation/message_form.js.map +1 -1
  5. package/build/components/conversation/message_list.d.ts +4 -2
  6. package/build/components/conversation/message_list.d.ts.map +1 -1
  7. package/build/components/conversation/message_list.js +115 -81
  8. package/build/components/conversation/message_list.js.map +1 -1
  9. package/build/components/conversation/missing_message.d.ts +2 -0
  10. package/build/components/conversation/missing_message.d.ts.map +1 -0
  11. package/build/components/conversation/missing_message.js +139 -0
  12. package/build/components/conversation/missing_message.js.map +1 -0
  13. package/build/contexts/api_provider.d.ts.map +1 -1
  14. package/build/contexts/api_provider.js +1 -2
  15. package/build/contexts/api_provider.js.map +1 -1
  16. package/build/contexts/conversation_context.d.ts +1 -3
  17. package/build/contexts/conversation_context.d.ts.map +1 -1
  18. package/build/contexts/conversation_context.js +18 -23
  19. package/build/contexts/conversation_context.js.map +1 -1
  20. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +4 -3
  21. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
  22. package/build/hooks/paginator_meta.d.ts +1 -3
  23. package/build/hooks/paginator_meta.d.ts.map +1 -1
  24. package/build/hooks/paginator_meta.js +8 -25
  25. package/build/hooks/paginator_meta.js.map +1 -1
  26. package/build/hooks/use_api.d.ts.map +1 -1
  27. package/build/hooks/use_api.js +8 -5
  28. package/build/hooks/use_api.js.map +1 -1
  29. package/build/hooks/use_conversation_messages.d.ts +10 -8
  30. package/build/hooks/use_conversation_messages.d.ts.map +1 -1
  31. package/build/hooks/use_conversation_messages.js +218 -81
  32. package/build/hooks/use_conversation_messages.js.map +1 -1
  33. package/build/hooks/use_conversation_messages_jolt_events.d.ts +1 -17
  34. package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
  35. package/build/hooks/use_conversation_messages_jolt_events.js +90 -83
  36. package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
  37. package/build/hooks/use_features.d.ts +2 -1
  38. package/build/hooks/use_features.d.ts.map +1 -1
  39. package/build/hooks/use_features.js +2 -1
  40. package/build/hooks/use_features.js.map +1 -1
  41. package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
  42. package/build/hooks/use_message_create_or_update.js +80 -91
  43. package/build/hooks/use_message_create_or_update.js.map +1 -1
  44. package/build/hooks/use_message_reaction_toggle.d.ts.map +1 -1
  45. package/build/hooks/use_message_reaction_toggle.js +40 -45
  46. package/build/hooks/use_message_reaction_toggle.js.map +1 -1
  47. package/build/hooks/use_read_receipts.d.ts +4 -3
  48. package/build/hooks/use_read_receipts.d.ts.map +1 -1
  49. package/build/hooks/use_suspense_api.d.ts +10 -6
  50. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  51. package/build/hooks/use_suspense_api.js +88 -65
  52. package/build/hooks/use_suspense_api.js.map +1 -1
  53. package/build/screens/conversation_screen.d.ts +1 -1
  54. package/build/screens/conversation_screen.d.ts.map +1 -1
  55. package/build/screens/conversation_screen.js +338 -463
  56. package/build/screens/conversation_screen.js.map +1 -1
  57. package/build/screens/message_actions_screen.d.ts.map +1 -1
  58. package/build/screens/message_actions_screen.js +26 -21
  59. package/build/screens/message_actions_screen.js.map +1 -1
  60. package/build/screens/message_report_screen.d.ts.map +1 -1
  61. package/build/screens/message_report_screen.js +44 -17
  62. package/build/screens/message_report_screen.js.map +1 -1
  63. package/build/screens/notification_settings/hooks/groups.d.ts +4 -3
  64. package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
  65. package/build/screens/reactions_screen.d.ts.map +1 -1
  66. package/build/screens/reactions_screen.js +88 -70
  67. package/build/screens/reactions_screen.js.map +1 -1
  68. package/build/types/api_primitives.d.ts +0 -1
  69. package/build/types/api_primitives.d.ts.map +1 -1
  70. package/build/types/api_primitives.js.map +1 -1
  71. package/build/utils/cache/messages_cache.d.ts +0 -1
  72. package/build/utils/cache/messages_cache.d.ts.map +1 -1
  73. package/build/utils/cache/messages_cache.js +0 -3
  74. package/build/utils/cache/messages_cache.js.map +1 -1
  75. package/build/utils/cache/messages_window.d.ts +11 -0
  76. package/build/utils/cache/messages_window.d.ts.map +1 -0
  77. package/build/utils/cache/messages_window.js +51 -0
  78. package/build/utils/cache/messages_window.js.map +1 -0
  79. package/build/utils/cache/optimistically_update_message.d.ts +1 -2
  80. package/build/utils/cache/optimistically_update_message.d.ts.map +1 -1
  81. package/build/utils/cache/optimistically_update_message.js +4 -4
  82. package/build/utils/cache/optimistically_update_message.js.map +1 -1
  83. package/build/utils/generate_placeholder_ulid.d.ts +6 -0
  84. package/build/utils/generate_placeholder_ulid.d.ts.map +1 -1
  85. package/build/utils/generate_placeholder_ulid.js +2 -2
  86. package/build/utils/generate_placeholder_ulid.js.map +1 -1
  87. package/build/utils/request/get_messages.d.ts +6 -18
  88. package/build/utils/request/get_messages.d.ts.map +1 -1
  89. package/build/utils/request/get_messages.js +12 -10
  90. package/build/utils/request/get_messages.js.map +1 -1
  91. package/package.json +3 -3
  92. package/src/__tests__/hooks/paginator_meta.test.ts +2 -73
  93. package/src/__tests__/hooks/use_features.test.ts +10 -2
  94. package/src/__utils__/query_client.ts +3 -0
  95. package/src/components/conversation/__tests__/message_list.test.tsx +0 -42
  96. package/src/components/conversation/message_form.tsx +30 -5
  97. package/src/components/conversation/message_list.tsx +44 -14
  98. package/src/components/conversation/missing_message.tsx +66 -0
  99. package/src/contexts/api_provider.tsx +1 -2
  100. package/src/contexts/conversation_context.tsx +1 -6
  101. package/src/hooks/__tests__/use_conversation_messages.test.tsx +333 -0
  102. package/src/hooks/__tests__/use_conversation_messages_jolt_events.test.tsx +87 -0
  103. package/src/hooks/__tests__/use_mark_latest_message_read.test.tsx +33 -0
  104. package/src/hooks/__tests__/use_message_create_or_update.test.tsx +2 -7
  105. package/src/hooks/paginator_meta.ts +5 -29
  106. package/src/hooks/use_api.ts +5 -4
  107. package/src/hooks/use_conversation_messages.ts +88 -43
  108. package/src/hooks/use_conversation_messages_jolt_events.ts +53 -62
  109. package/src/hooks/use_features.ts +3 -2
  110. package/src/hooks/use_message_create_or_update.ts +8 -8
  111. package/src/hooks/use_message_reaction_toggle.ts +1 -3
  112. package/src/hooks/use_suspense_api.ts +17 -8
  113. package/src/screens/conversation_screen.tsx +63 -123
  114. package/src/screens/message_actions_screen.tsx +5 -3
  115. package/src/screens/message_report_screen.tsx +3 -2
  116. package/src/screens/reactions_screen.tsx +4 -2
  117. package/src/types/api_primitives.ts +0 -1
  118. package/src/utils/cache/__tests__/messages_cache.test.ts +3 -15
  119. package/src/utils/cache/__tests__/messages_cache_deletion.test.ts +2 -1
  120. package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +3 -2
  121. package/src/utils/cache/__tests__/messages_window.test.ts +78 -0
  122. package/src/utils/cache/messages_cache.ts +0 -3
  123. package/src/utils/cache/messages_window.ts +55 -0
  124. package/src/utils/cache/optimistically_update_message.ts +5 -2
  125. package/src/utils/generate_placeholder_ulid.ts +2 -2
  126. package/src/utils/request/get_messages.ts +14 -12
  127. package/build/components/conversation/anchor_not_found_boundary.d.ts +0 -18
  128. package/build/components/conversation/anchor_not_found_boundary.d.ts.map +0 -1
  129. package/build/components/conversation/anchor_not_found_boundary.js +0 -20
  130. package/build/components/conversation/anchor_not_found_boundary.js.map +0 -1
  131. package/build/hooks/use_conversation_message_lookup.d.ts +0 -7
  132. package/build/hooks/use_conversation_message_lookup.d.ts.map +0 -1
  133. package/build/hooks/use_conversation_message_lookup.js +0 -52
  134. package/build/hooks/use_conversation_message_lookup.js.map +0 -1
  135. package/build/hooks/use_fetch_newer_messages.d.ts +0 -9
  136. package/build/hooks/use_fetch_newer_messages.d.ts.map +0 -1
  137. package/build/hooks/use_fetch_newer_messages.js +0 -69
  138. package/build/hooks/use_fetch_newer_messages.js.map +0 -1
  139. package/build/hooks/use_fetch_newer_on_foreground.d.ts +0 -8
  140. package/build/hooks/use_fetch_newer_on_foreground.d.ts.map +0 -1
  141. package/build/hooks/use_fetch_newer_on_foreground.js +0 -42
  142. package/build/hooks/use_fetch_newer_on_foreground.js.map +0 -1
  143. package/build/hooks/use_held_back_messages.d.ts +0 -11
  144. package/build/hooks/use_held_back_messages.d.ts.map +0 -1
  145. package/build/hooks/use_held_back_messages.js +0 -24
  146. package/build/hooks/use_held_back_messages.js.map +0 -1
  147. package/build/utils/cache/find_message_in_caches.d.ts +0 -4
  148. package/build/utils/cache/find_message_in_caches.d.ts.map +0 -1
  149. package/build/utils/cache/find_message_in_caches.js +0 -16
  150. package/build/utils/cache/find_message_in_caches.js.map +0 -1
  151. package/build/utils/cache/invalidate_refetchable_queries.d.ts +0 -3
  152. package/build/utils/cache/invalidate_refetchable_queries.d.ts.map +0 -1
  153. package/build/utils/cache/invalidate_refetchable_queries.js +0 -8
  154. package/build/utils/cache/invalidate_refetchable_queries.js.map +0 -1
  155. package/build/utils/cache/prepend_newer_page.d.ts +0 -7
  156. package/build/utils/cache/prepend_newer_page.d.ts.map +0 -1
  157. package/build/utils/cache/prepend_newer_page.js +0 -15
  158. package/build/utils/cache/prepend_newer_page.js.map +0 -1
  159. package/build/utils/gated_message_cache.d.ts +0 -7
  160. package/build/utils/gated_message_cache.d.ts.map +0 -1
  161. package/build/utils/gated_message_cache.js +0 -13
  162. package/build/utils/gated_message_cache.js.map +0 -1
  163. package/build/utils/ulid.d.ts +0 -3
  164. package/build/utils/ulid.d.ts.map +0 -1
  165. package/build/utils/ulid.js +0 -7
  166. package/build/utils/ulid.js.map +0 -1
  167. package/src/__tests__/hooks/use_conversation_messages.test.ts +0 -22
  168. package/src/__tests__/hooks/use_conversation_messages_jolt_events.test.ts +0 -33
  169. package/src/__tests__/utils/gated_message_cache.test.ts +0 -26
  170. package/src/__tests__/utils/request/get_messages.test.ts +0 -24
  171. package/src/__tests__/utils/ulid.test.ts +0 -15
  172. package/src/components/conversation/__tests__/anchor_not_found_boundary.test.tsx +0 -51
  173. package/src/components/conversation/anchor_not_found_boundary.tsx +0 -21
  174. package/src/hooks/__tests__/use_fetch_newer_messages.test.tsx +0 -95
  175. package/src/hooks/__tests__/use_held_back_messages.test.tsx +0 -60
  176. package/src/hooks/__tests__/use_message_reaction_toggle.test.tsx +0 -73
  177. package/src/hooks/use_conversation_message_lookup.ts +0 -29
  178. package/src/hooks/use_fetch_newer_messages.ts +0 -52
  179. package/src/hooks/use_fetch_newer_on_foreground.ts +0 -25
  180. package/src/hooks/use_held_back_messages.ts +0 -33
  181. package/src/utils/cache/__tests__/find_message_in_caches.test.ts +0 -37
  182. package/src/utils/cache/__tests__/invalidate_refetchable_queries.test.ts +0 -23
  183. package/src/utils/cache/__tests__/prepend_newer_page.test.ts +0 -34
  184. package/src/utils/cache/find_message_in_caches.ts +0 -20
  185. package/src/utils/cache/invalidate_refetchable_queries.ts +0 -9
  186. package/src/utils/cache/prepend_newer_page.ts +0 -19
  187. package/src/utils/gated_message_cache.ts +0 -19
  188. package/src/utils/ulid.ts +0 -11
@@ -1,11 +1,10 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
2
  import { HeaderTitle, PlatformPressable } from '@react-navigation/elements';
3
3
  import { CommonActions, useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native';
4
- import React, { startTransition, useCallback, useEffect, useRef, useState } from 'react';
4
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
5
5
  import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
7
  import { Badge, Icon } from '../components';
8
- import { AnchorNotFoundBoundary } from '../components/conversation/anchor_not_found_boundary';
9
8
  import { ConversationStartBanner } from '../components/conversation/conversation_start_banner';
10
9
  import { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button';
11
10
  import { MessageForm } from '../components/conversation/message_form';
@@ -19,29 +18,22 @@ import { ConversationContextProvider } from '../contexts/conversation_context';
19
18
  import { useMessageAvailableMembersAction } from '../hooks/direct_messages/use_message_available_members_action';
20
19
  import { useConversation } from '../hooks/use_conversation';
21
20
  import { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events';
22
- import { useConversationMessages } from '../hooks/use_conversation_messages';
21
+ import { dropMessagesWindowIfBehind, useConversationMessages } from '../hooks/use_conversation_messages';
23
22
  import { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events';
24
- import { useFetchNewerMessages } from '../hooks/use_fetch_newer_messages';
25
- import { useFetchNewerOnForeground } from '../hooks/use_fetch_newer_on_foreground';
26
- import { useHeldBackMessages } from '../hooks/use_held_back_messages';
27
23
  import { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read';
28
24
  import { analyticsEvents, normalizeAnalyticsMetadata, usePublishProductAnalyticsEvent } from '../hooks/use_product_analytics';
29
25
  import { useRestAwayFromDismissEdge } from '../hooks/use_rest_away_from_dismiss_edge';
30
26
  import { useVideoModerationJoltEvents } from '../hooks/use_video_moderation_jolt_events';
31
- import { newestPersistedMessageId } from '../utils/cache/messages_cache';
32
- import { gatedMessageCache } from '../utils/gated_message_cache';
33
- import { getMessagesQueryKey } from '../utils/request/get_messages';
34
- import { decodeUlidTime } from '../utils/ulid';
27
+ import { Log } from '../utils';
35
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
36
29
  export function ConversationScreen(t0) {
37
- const $ = _c(24);
30
+ const $ = _c(13);
38
31
  const {
39
32
  route
40
33
  } = t0;
41
34
  const {
42
35
  conversation_id,
43
- reply_root_id,
44
- initial_message_id
36
+ reply_root_id
45
37
  } = route.params;
46
38
  let t1;
47
39
  if ($[0] !== conversation_id) {
@@ -57,111 +49,57 @@ export function ConversationScreen(t0) {
57
49
  data: conversation
58
50
  } = useConversation(t1);
59
51
  let t2;
60
- if ($[2] !== conversation?.lastMessageCreatedAt || $[3] !== initial_message_id) {
61
- t2 = () => isBeforeLatestMessage(initial_message_id, conversation?.lastMessageCreatedAt) ? initial_message_id : null;
62
- $[2] = conversation?.lastMessageCreatedAt;
63
- $[3] = initial_message_id;
64
- $[4] = t2;
52
+ if ($[2] !== conversation) {
53
+ t2 = normalizeAnalyticsMetadata(conversation);
54
+ $[2] = conversation;
55
+ $[3] = t2;
65
56
  } else {
66
- t2 = $[4];
57
+ t2 = $[3];
67
58
  }
68
- const [anchor, setAnchor] = useState(t2);
69
59
  let t3;
70
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
71
- t3 = () => startTransition(() => setAnchor(null));
72
- $[5] = t3;
73
- } else {
74
- t3 = $[5];
75
- }
76
- const exitAnchoredMode = t3;
77
- let t4;
78
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
79
- t4 = () => setAnchor(null);
80
- $[6] = t4;
60
+ if ($[4] !== reply_root_id || $[5] !== t2) {
61
+ t3 = {
62
+ reply_root_id,
63
+ ...t2
64
+ };
65
+ $[4] = reply_root_id;
66
+ $[5] = t2;
67
+ $[6] = t3;
81
68
  } else {
82
- t4 = $[6];
69
+ t3 = $[6];
83
70
  }
84
- const dropAnchor = t4;
71
+ usePublishProductAnalyticsEvent(analyticsEvents.conversation_show_opened, t3);
72
+ const t4 = reply_root_id ?? null;
85
73
  let t5;
86
- if ($[7] !== conversation) {
87
- t5 = normalizeAnalyticsMetadata(conversation);
88
- $[7] = conversation;
74
+ if ($[7] !== route) {
75
+ t5 = /*#__PURE__*/_jsx(ConversationScreenContent, {
76
+ route: route
77
+ });
78
+ $[7] = route;
89
79
  $[8] = t5;
90
80
  } else {
91
81
  t5 = $[8];
92
82
  }
93
83
  let t6;
94
- if ($[9] !== reply_root_id || $[10] !== t5) {
95
- t6 = {
96
- reply_root_id,
97
- ...t5
98
- };
99
- $[9] = reply_root_id;
100
- $[10] = t5;
101
- $[11] = t6;
102
- } else {
103
- t6 = $[11];
104
- }
105
- usePublishProductAnalyticsEvent(analyticsEvents.conversation_show_opened, t6);
106
- const t7 = reply_root_id ?? null;
107
- let t8;
108
- if ($[12] !== anchor || $[13] !== conversation_id || $[14] !== reply_root_id) {
109
- t8 = getMessagesQueryKey({
110
- conversation_id,
111
- reply_root_id,
112
- anchor
113
- });
114
- $[12] = anchor;
115
- $[13] = conversation_id;
116
- $[14] = reply_root_id;
117
- $[15] = t8;
118
- } else {
119
- t8 = $[15];
120
- }
121
- let t9;
122
- if ($[16] !== anchor || $[17] !== route) {
123
- t9 = anchor ? /*#__PURE__*/_jsx(AnchorNotFoundBoundary, {
124
- onAnchorNotFound: dropAnchor,
125
- children: /*#__PURE__*/_jsx(ConversationScreenContent, {
126
- route: route,
127
- anchor: anchor,
128
- onExitAnchoredMode: exitAnchoredMode
129
- })
130
- }) : /*#__PURE__*/_jsx(ConversationScreenContent, {
131
- route: route,
132
- anchor: null,
133
- onExitAnchoredMode: exitAnchoredMode
134
- });
135
- $[16] = anchor;
136
- $[17] = route;
137
- $[18] = t9;
138
- } else {
139
- t9 = $[18];
140
- }
141
- let t10;
142
- if ($[19] !== conversation_id || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
143
- t10 = /*#__PURE__*/_jsx(ConversationContextProvider, {
84
+ if ($[9] !== conversation_id || $[10] !== t4 || $[11] !== t5) {
85
+ t6 = /*#__PURE__*/_jsx(ConversationContextProvider, {
144
86
  conversationId: conversation_id,
145
- currentPageReplyRootId: t7,
146
- messagesQueryKey: t8,
147
- children: t9
87
+ currentPageReplyRootId: t4,
88
+ children: t5
148
89
  });
149
- $[19] = conversation_id;
150
- $[20] = t7;
151
- $[21] = t8;
152
- $[22] = t9;
153
- $[23] = t10;
90
+ $[9] = conversation_id;
91
+ $[10] = t4;
92
+ $[11] = t5;
93
+ $[12] = t6;
154
94
  } else {
155
- t10 = $[23];
95
+ t6 = $[12];
156
96
  }
157
- return t10;
97
+ return t6;
158
98
  }
159
99
  function ConversationScreenContent(t0) {
160
- const $ = _c(121);
100
+ const $ = _c(103);
161
101
  const {
162
- route,
163
- anchor,
164
- onExitAnchoredMode
102
+ route
165
103
  } = t0;
166
104
  const styles = useStyles();
167
105
  const navigation = useNavigation();
@@ -169,21 +107,21 @@ function ConversationScreenContent(t0) {
169
107
  conversation_id,
170
108
  editing_message_id,
171
109
  reply_root_id,
172
- reply_root_author_name
110
+ reply_root_author_name,
111
+ initial_message_id
173
112
  } = route.params;
174
113
  const {
175
114
  data: conversation
176
115
  } = useConversation(route.params);
177
- const anchored = !!anchor;
178
116
  let t1;
179
- if ($[0] !== anchor || $[1] !== conversation_id || $[2] !== reply_root_id) {
117
+ if ($[0] !== conversation_id || $[1] !== initial_message_id || $[2] !== reply_root_id) {
180
118
  t1 = {
181
119
  conversation_id,
182
120
  reply_root_id,
183
- anchor
121
+ anchor: initial_message_id
184
122
  };
185
- $[0] = anchor;
186
- $[1] = conversation_id;
123
+ $[0] = conversation_id;
124
+ $[1] = initial_message_id;
187
125
  $[2] = reply_root_id;
188
126
  $[3] = t1;
189
127
  } else {
@@ -191,141 +129,54 @@ function ConversationScreenContent(t0) {
191
129
  }
192
130
  const {
193
131
  messages,
132
+ behind,
194
133
  fetchNextPage,
195
- hasNextPage,
196
- fetchPreviousPage,
197
- hasPreviousPage,
198
- isFetchingPreviousPage,
199
- queryKey
134
+ fetchNewer,
135
+ fetchLiveWindow,
136
+ hasNextPage
200
137
  } = useConversationMessages(t1);
201
- const behindLatest = anchored && hasPreviousPage;
202
- const caughtUp = !hasPreviousPage;
203
- const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
204
- const readingHistory = showJumpToBottomButton;
205
138
  let t2;
206
- if ($[4] !== messages) {
207
- t2 = newestPersistedMessageId(messages);
208
- $[4] = messages;
139
+ if ($[4] !== conversation_id) {
140
+ t2 = {
141
+ conversationId: conversation_id
142
+ };
143
+ $[4] = conversation_id;
209
144
  $[5] = t2;
210
145
  } else {
211
146
  t2 = $[5];
212
147
  }
213
- const newestMessageId = t2;
214
- const t3 = anchored ? onExitAnchoredMode : undefined;
215
- let t4;
216
- if ($[6] !== conversation_id || $[7] !== queryKey || $[8] !== reply_root_id || $[9] !== t3) {
217
- t4 = {
218
- conversation_id,
219
- reply_root_id,
220
- queryKey,
221
- onTooFarBehind: t3
222
- };
223
- $[6] = conversation_id;
224
- $[7] = queryKey;
225
- $[8] = reply_root_id;
226
- $[9] = t3;
227
- $[10] = t4;
228
- } else {
229
- t4 = $[10];
230
- }
231
- const fetchNewer = useFetchNewerMessages(t4);
232
- let t5;
233
- if ($[11] !== caughtUp || $[12] !== fetchNewer || $[13] !== newestMessageId || $[14] !== readingHistory) {
234
- t5 = {
235
- fetchNewer,
236
- newestMessageId,
237
- readingHistory,
238
- caughtUp
239
- };
240
- $[11] = caughtUp;
241
- $[12] = fetchNewer;
242
- $[13] = newestMessageId;
243
- $[14] = readingHistory;
244
- $[15] = t5;
245
- } else {
246
- t5 = $[15];
247
- }
248
- const {
249
- onSkippedNewMessage
250
- } = useHeldBackMessages(t5);
251
- let t6;
252
- if ($[16] !== conversation_id) {
253
- t6 = {
148
+ useConversationJoltEvents(t2);
149
+ let t3;
150
+ if ($[6] !== conversation_id) {
151
+ t3 = {
254
152
  conversationId: conversation_id
255
153
  };
256
- $[16] = conversation_id;
257
- $[17] = t6;
258
- } else {
259
- t6 = $[17];
260
- }
261
- useConversationJoltEvents(t6);
262
- const t7 = reply_root_id ?? null;
263
- const t8 = caughtUp && !readingHistory;
264
- let t9;
265
- if ($[18] !== onSkippedNewMessage || $[19] !== queryKey || $[20] !== t8) {
266
- t9 = gatedMessageCache({
267
- queryKey,
268
- acceptNewMessages: t8,
269
- onSkippedNewMessage
270
- });
271
- $[18] = onSkippedNewMessage;
272
- $[19] = queryKey;
273
- $[20] = t8;
274
- $[21] = t9;
275
- } else {
276
- t9 = $[21];
277
- }
278
- let t10;
279
- if ($[22] !== conversation_id || $[23] !== t7 || $[24] !== t9) {
280
- t10 = {
281
- conversationId: conversation_id,
282
- replyRootId: t7,
283
- messageCache: t9
284
- };
285
- $[22] = conversation_id;
286
- $[23] = t7;
287
- $[24] = t9;
288
- $[25] = t10;
154
+ $[6] = conversation_id;
155
+ $[7] = t3;
289
156
  } else {
290
- t10 = $[25];
157
+ t3 = $[7];
291
158
  }
292
- useConversationMessagesJoltEvents(t10);
159
+ useConversationMessagesJoltEvents(t3);
293
160
  const {
294
161
  markHandledByMessageForm
295
162
  } = useVideoModerationJoltEvents();
296
163
  useEnsureConversationsRouteExists();
297
- const t11 = !behindLatest;
298
- let t12;
299
- if ($[26] !== conversation || $[27] !== messages || $[28] !== t11) {
300
- t12 = {
164
+ const t4 = !behind;
165
+ let t5;
166
+ if ($[8] !== conversation || $[9] !== messages || $[10] !== t4) {
167
+ t5 = {
301
168
  conversation,
302
169
  messages,
303
- enabled: t11
304
- };
305
- $[26] = conversation;
306
- $[27] = messages;
307
- $[28] = t11;
308
- $[29] = t12;
309
- } else {
310
- t12 = $[29];
311
- }
312
- useMarkLatestMessageRead(t12);
313
- const t13 = anchored && caughtUp;
314
- let t14;
315
- if ($[30] !== fetchNewer || $[31] !== newestMessageId || $[32] !== t13) {
316
- t14 = {
317
- fetchNewer,
318
- newestMessageId,
319
- enabled: t13
170
+ enabled: t4
320
171
  };
321
- $[30] = fetchNewer;
322
- $[31] = newestMessageId;
323
- $[32] = t13;
324
- $[33] = t14;
172
+ $[8] = conversation;
173
+ $[9] = messages;
174
+ $[10] = t4;
175
+ $[11] = t5;
325
176
  } else {
326
- t14 = $[33];
177
+ t5 = $[11];
327
178
  }
328
- useFetchNewerOnForeground(t14);
179
+ useMarkLatestMessageRead(t5);
329
180
  const noMessages = messages.length === 0;
330
181
  const {
331
182
  repliesDisabled,
@@ -335,47 +186,57 @@ function ConversationScreenContent(t0) {
335
186
  } = conversation;
336
187
  const canReply = memberAbility?.canReply;
337
188
  const showLeaderDisabledReplyBanner = canReply && repliesDisabled;
338
- let t15;
339
- if ($[34] !== editing_message_id || $[35] !== messages) {
340
- let t16;
341
- if ($[37] !== editing_message_id) {
342
- t16 = m => String(m.id) === String(editing_message_id);
343
- $[37] = editing_message_id;
344
- $[38] = t16;
189
+ let t6;
190
+ if ($[12] !== editing_message_id || $[13] !== messages) {
191
+ let t7;
192
+ if ($[15] !== editing_message_id) {
193
+ t7 = m => String(m.id) === String(editing_message_id);
194
+ $[15] = editing_message_id;
195
+ $[16] = t7;
345
196
  } else {
346
- t16 = $[38];
197
+ t7 = $[16];
347
198
  }
348
- t15 = messages.find(t16);
349
- $[34] = editing_message_id;
350
- $[35] = messages;
351
- $[36] = t15;
199
+ t6 = messages.find(t7);
200
+ $[12] = editing_message_id;
201
+ $[13] = messages;
202
+ $[14] = t6;
352
203
  } else {
353
- t15 = $[36];
204
+ t6 = $[14];
354
205
  }
355
- const currentlyEditingMessage = t15;
356
- let t16;
357
- if ($[39] !== reply_root_author_name) {
358
- t16 = reply_root_author_name?.split(" ")[0];
359
- $[39] = reply_root_author_name;
360
- $[40] = t16;
206
+ const currentlyEditingMessage = t6;
207
+ let t7;
208
+ if ($[17] !== reply_root_author_name) {
209
+ t7 = reply_root_author_name?.split(" ")[0];
210
+ $[17] = reply_root_author_name;
211
+ $[18] = t7;
361
212
  } else {
362
- t16 = $[40];
213
+ t7 = $[18];
363
214
  }
364
- const replyRootAuthorFirstName = t16;
215
+ const replyRootAuthorFirstName = t7;
365
216
  const replyHeaderTitle = replyRootAuthorFirstName ? `Reply to ${replyRootAuthorFirstName}` : "Reply";
366
217
  const muted = conversation.conversationMembership?.muted ?? conversation.muted;
367
218
  const listRef = useRef(null);
368
- const [hasDragged, setHasDragged] = useState(false);
369
- const holdListPosition = behindLatest || readingHistory;
370
- let t17;
371
- if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
372
- t17 = {
219
+ const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
220
+ let t8;
221
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
222
+ t8 = event => {
223
+ const offsetY = event.nativeEvent.contentOffset.y;
224
+ setShowJumpToBottomButton(offsetY > 200);
225
+ };
226
+ $[19] = t8;
227
+ } else {
228
+ t8 = $[19];
229
+ }
230
+ const trackScroll = t8;
231
+ let t9;
232
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
233
+ t9 = {
373
234
  listRef,
374
235
  enabled: Platform.OS === "ios"
375
236
  };
376
- $[41] = t17;
237
+ $[20] = t9;
377
238
  } else {
378
- t17 = $[41];
239
+ t9 = $[20];
379
240
  }
380
241
  const {
381
242
  restOffset,
@@ -383,82 +244,52 @@ function ConversationScreenContent(t0) {
383
244
  onContentSizeChange,
384
245
  onMomentumScrollEnd,
385
246
  onScrollEndDrag
386
- } = useRestAwayFromDismissEdge(t17);
387
- let t18;
388
- if ($[42] !== restOffset) {
389
- t18 = () => {
247
+ } = useRestAwayFromDismissEdge(t9);
248
+ const [anchorMessageId, setAnchorMessageId] = useState(initial_message_id);
249
+ let t10;
250
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
251
+ t10 = () => setAnchorMessageId(null);
252
+ $[21] = t10;
253
+ } else {
254
+ t10 = $[21];
255
+ }
256
+ const releaseAnchor = t10;
257
+ let t11;
258
+ if ($[22] !== restOffset) {
259
+ t11 = t12 => {
260
+ const animated = t12 === undefined ? true : t12;
261
+ releaseAnchor();
390
262
  listRef.current?.scrollToOffset({
391
- offset: restOffset
263
+ offset: restOffset,
264
+ animated
392
265
  });
393
266
  };
394
- $[42] = restOffset;
395
- $[43] = t18;
396
- } else {
397
- t18 = $[43];
398
- }
399
- const handleReturnToBottom = t18;
400
- let t19;
401
- if ($[44] !== handleReturnToBottom || $[45] !== onExitAnchoredMode) {
402
- t19 = () => {
403
- onExitAnchoredMode();
404
- handleReturnToBottom();
405
- };
406
- $[44] = handleReturnToBottom;
407
- $[45] = onExitAnchoredMode;
408
- $[46] = t19;
409
- } else {
410
- t19 = $[46];
411
- }
412
- const exitAnchoredMode = t19;
413
- let t20;
414
- if ($[47] !== anchored || $[48] !== exitAnchoredMode || $[49] !== handleReturnToBottom) {
415
- t20 = () => {
416
- setShowJumpToBottomButton(false);
417
- if (anchored) {
418
- exitAnchoredMode();
419
- } else {
420
- handleReturnToBottom();
421
- }
422
- };
423
- $[47] = anchored;
424
- $[48] = exitAnchoredMode;
425
- $[49] = handleReturnToBottom;
426
- $[50] = t20;
427
- } else {
428
- t20 = $[50];
429
- }
430
- const jumpToLatest = t20;
431
- let t21;
432
- if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
433
- t21 = event => {
434
- const offsetY = event.nativeEvent.contentOffset.y;
435
- setShowJumpToBottomButton(offsetY > 200);
436
- };
437
- $[51] = t21;
267
+ $[22] = restOffset;
268
+ $[23] = t11;
438
269
  } else {
439
- t21 = $[51];
270
+ t11 = $[23];
440
271
  }
441
- const trackScroll = t21;
442
- let t22;
443
- if ($[52] !== fetchPreviousPage || $[53] !== hasPreviousPage || $[54] !== isFetchingPreviousPage) {
444
- t22 = () => {
445
- if (!hasPreviousPage || isFetchingPreviousPage) {
446
- return;
272
+ const handleReturnToBottom = t11;
273
+ const logWindowFetchFailure = _temp;
274
+ let t12;
275
+ if ($[24] !== behind || $[25] !== fetchLiveWindow || $[26] !== handleReturnToBottom) {
276
+ t12 = async () => {
277
+ if (behind) {
278
+ await fetchLiveWindow();
447
279
  }
448
- setHasDragged(false);
449
- fetchPreviousPage();
280
+ handleReturnToBottom(false);
450
281
  };
451
- $[52] = fetchPreviousPage;
452
- $[53] = hasPreviousPage;
453
- $[54] = isFetchingPreviousPage;
454
- $[55] = t22;
282
+ $[24] = behind;
283
+ $[25] = fetchLiveWindow;
284
+ $[26] = handleReturnToBottom;
285
+ $[27] = t12;
455
286
  } else {
456
- t22 = $[55];
287
+ t12 = $[27];
457
288
  }
458
- const loadNewerMessages = t22;
459
- let t23;
460
- if ($[56] !== badges?.[0] || $[57] !== conversation.deleted || $[58] !== muted || $[59] !== navigation || $[60] !== replyHeaderTitle || $[61] !== reply_root_id || $[62] !== title) {
461
- t23 = () => {
289
+ const returnToLatest = t12;
290
+ let t13;
291
+ if ($[28] !== badges?.[0] || $[29] !== conversation.deleted || $[30] !== muted || $[31] !== navigation || $[32] !== replyHeaderTitle || $[33] !== reply_root_id || $[34] !== title) {
292
+ t13 = () => {
462
293
  if (reply_root_id) {
463
294
  navigation.setParams({
464
295
  title: replyHeaderTitle
@@ -472,86 +303,124 @@ function ConversationScreenContent(t0) {
472
303
  });
473
304
  }
474
305
  };
475
- $[56] = badges?.[0];
476
- $[57] = conversation.deleted;
477
- $[58] = muted;
478
- $[59] = navigation;
479
- $[60] = replyHeaderTitle;
480
- $[61] = reply_root_id;
481
- $[62] = title;
482
- $[63] = t23;
483
- } else {
484
- t23 = $[63];
485
- }
486
- const t24 = conversation?.deleted;
487
- let t25;
488
- if ($[64] !== badges || $[65] !== muted || $[66] !== navigation || $[67] !== replyHeaderTitle || $[68] !== reply_root_id || $[69] !== t24 || $[70] !== title) {
489
- t25 = [navigation, title, badges, t24, reply_root_id, replyHeaderTitle, muted];
490
- $[64] = badges;
491
- $[65] = muted;
492
- $[66] = navigation;
493
- $[67] = replyHeaderTitle;
494
- $[68] = reply_root_id;
495
- $[69] = t24;
496
- $[70] = title;
497
- $[71] = t25;
498
- } else {
499
- t25 = $[71];
500
- }
501
- useEffect(t23, t25);
306
+ $[28] = badges?.[0];
307
+ $[29] = conversation.deleted;
308
+ $[30] = muted;
309
+ $[31] = navigation;
310
+ $[32] = replyHeaderTitle;
311
+ $[33] = reply_root_id;
312
+ $[34] = title;
313
+ $[35] = t13;
314
+ } else {
315
+ t13 = $[35];
316
+ }
317
+ const t14 = conversation?.deleted;
318
+ let t15;
319
+ if ($[36] !== badges || $[37] !== muted || $[38] !== navigation || $[39] !== replyHeaderTitle || $[40] !== reply_root_id || $[41] !== t14 || $[42] !== title) {
320
+ t15 = [navigation, title, badges, t14, reply_root_id, replyHeaderTitle, muted];
321
+ $[36] = badges;
322
+ $[37] = muted;
323
+ $[38] = navigation;
324
+ $[39] = replyHeaderTitle;
325
+ $[40] = reply_root_id;
326
+ $[41] = t14;
327
+ $[42] = title;
328
+ $[43] = t15;
329
+ } else {
330
+ t15 = $[43];
331
+ }
332
+ useEffect(t13, t15);
333
+ let t16;
334
+ let t17;
335
+ if ($[44] !== initial_message_id || $[45] !== navigation) {
336
+ t16 = () => {
337
+ if (!initial_message_id) {
338
+ return;
339
+ }
340
+ navigation.setParams({
341
+ initial_message_id: null
342
+ });
343
+ };
344
+ t17 = [initial_message_id, navigation];
345
+ $[44] = initial_message_id;
346
+ $[45] = navigation;
347
+ $[46] = t16;
348
+ $[47] = t17;
349
+ } else {
350
+ t16 = $[46];
351
+ t17 = $[47];
352
+ }
353
+ useEffect(t16, t17);
354
+ let t18;
355
+ let t19;
356
+ if ($[48] !== conversation_id || $[49] !== reply_root_id) {
357
+ t18 = () => () => dropMessagesWindowIfBehind({
358
+ conversation_id,
359
+ reply_root_id
360
+ });
361
+ t19 = [conversation_id, reply_root_id];
362
+ $[48] = conversation_id;
363
+ $[49] = reply_root_id;
364
+ $[50] = t18;
365
+ $[51] = t19;
366
+ } else {
367
+ t18 = $[50];
368
+ t19 = $[51];
369
+ }
370
+ useEffect(t18, t19);
502
371
  if (!conversation || conversation.deleted) {
503
- let t26;
504
- if ($[72] === Symbol.for("react.memo_cache_sentinel")) {
505
- t26 = /*#__PURE__*/_jsx(BlankState.Imagery, {
372
+ let t20;
373
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
374
+ t20 = /*#__PURE__*/_jsx(BlankState.Imagery, {
506
375
  name: "general.outlinedTextMessage"
507
376
  });
508
- $[72] = t26;
377
+ $[52] = t20;
509
378
  } else {
510
- t26 = $[72];
379
+ t20 = $[52];
511
380
  }
512
- let t27;
513
- if ($[73] === Symbol.for("react.memo_cache_sentinel")) {
514
- t27 = /*#__PURE__*/_jsx(BlankState.Content, {
381
+ let t21;
382
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
383
+ t21 = /*#__PURE__*/_jsx(BlankState.Content, {
515
384
  children: /*#__PURE__*/_jsx(BlankState.Heading, {
516
385
  children: "This conversation has been deleted"
517
386
  })
518
387
  });
519
- $[73] = t27;
388
+ $[53] = t21;
520
389
  } else {
521
- t27 = $[73];
390
+ t21 = $[53];
522
391
  }
523
- let t28;
524
- if ($[74] !== navigation.goBack) {
525
- t28 = /*#__PURE__*/_jsxs(BlankState.Root, {
526
- children: [t26, t27, /*#__PURE__*/_jsx(BlankState.Button, {
392
+ let t22;
393
+ if ($[54] !== navigation.goBack) {
394
+ t22 = /*#__PURE__*/_jsxs(BlankState.Root, {
395
+ children: [t20, t21, /*#__PURE__*/_jsx(BlankState.Button, {
527
396
  onPress: navigation.goBack,
528
397
  title: "Back to conversations",
529
398
  accessibilityHint: "Navigates back to the conversations list",
530
399
  accessibilityRole: "link"
531
400
  })]
532
401
  });
533
- $[74] = navigation.goBack;
534
- $[75] = t28;
402
+ $[54] = navigation.goBack;
403
+ $[55] = t22;
535
404
  } else {
536
- t28 = $[75];
405
+ t22 = $[55];
537
406
  }
538
- let t29;
539
- if ($[76] !== styles.container || $[77] !== t28) {
540
- t29 = /*#__PURE__*/_jsx(View, {
407
+ let t23;
408
+ if ($[56] !== styles.container || $[57] !== t22) {
409
+ t23 = /*#__PURE__*/_jsx(View, {
541
410
  style: styles.container,
542
- children: t28
411
+ children: t22
543
412
  });
544
- $[76] = styles.container;
545
- $[77] = t28;
546
- $[78] = t29;
413
+ $[56] = styles.container;
414
+ $[57] = t22;
415
+ $[58] = t23;
547
416
  } else {
548
- t29 = $[78];
417
+ t23 = $[58];
549
418
  }
550
- return t29;
419
+ return t23;
551
420
  }
552
- let t26;
553
- if ($[79] !== anchor || $[80] !== anchored || $[81] !== conversation || $[82] !== conversation_id || $[83] !== fetchNextPage || $[84] !== hasDragged || $[85] !== hasNextPage || $[86] !== holdListPosition || $[87] !== loadNewerMessages || $[88] !== messages || $[89] !== noMessages || $[90] !== onContentSizeChange || $[91] !== onLayout || $[92] !== onMomentumScrollEnd || $[93] !== onScrollEndDrag || $[94] !== reply_root_id || $[95] !== styles.emptyState) {
554
- t26 = noMessages ? /*#__PURE__*/_jsx(View, {
421
+ let t20;
422
+ if ($[59] !== anchorMessageId || $[60] !== behind || $[61] !== conversation || $[62] !== conversation_id || $[63] !== fetchNewer || $[64] !== fetchNextPage || $[65] !== hasNextPage || $[66] !== messages || $[67] !== noMessages || $[68] !== onContentSizeChange || $[69] !== onLayout || $[70] !== onMomentumScrollEnd || $[71] !== onScrollEndDrag || $[72] !== reply_root_id || $[73] !== styles.emptyState) {
423
+ t20 = noMessages ? /*#__PURE__*/_jsx(View, {
555
424
  style: styles.emptyState,
556
425
  children: /*#__PURE__*/_jsx(ConversationStartBanner, {
557
426
  conversation: conversation,
@@ -563,120 +432,127 @@ function ConversationScreenContent(t0) {
563
432
  conversationId: conversation_id,
564
433
  messages: messages,
565
434
  replyRootId: reply_root_id,
566
- anchorMessageId: anchor,
435
+ anchorMessageId: anchorMessageId,
436
+ behind: behind,
567
437
  hasNextPage: hasNextPage,
568
438
  onEndReached: () => fetchNextPage(),
439
+ onStartReached: () => fetchNewer().catch(logWindowFetchFailure),
569
440
  onScroll: trackScroll,
570
441
  onLayout: onLayout,
571
442
  onContentSizeChange: onContentSizeChange,
572
443
  onScrollEndDrag: onScrollEndDrag,
573
- onMomentumScrollEnd: onMomentumScrollEnd,
574
- onScrollBeginDrag: anchored ? () => setHasDragged(true) : undefined,
575
- onStartReached: anchored && hasDragged ? loadNewerMessages : undefined,
576
- onStartReachedThreshold: anchored ? 0.5 : undefined,
577
- maintainVisibleContentPosition: holdListPosition ? {
578
- minIndexForVisible: 0
579
- } : undefined
444
+ onMomentumScrollEnd: onMomentumScrollEnd
580
445
  });
581
- $[79] = anchor;
582
- $[80] = anchored;
583
- $[81] = conversation;
584
- $[82] = conversation_id;
585
- $[83] = fetchNextPage;
586
- $[84] = hasDragged;
587
- $[85] = hasNextPage;
588
- $[86] = holdListPosition;
589
- $[87] = loadNewerMessages;
590
- $[88] = messages;
591
- $[89] = noMessages;
592
- $[90] = onContentSizeChange;
593
- $[91] = onLayout;
594
- $[92] = onMomentumScrollEnd;
595
- $[93] = onScrollEndDrag;
596
- $[94] = reply_root_id;
597
- $[95] = styles.emptyState;
598
- $[96] = t26;
599
- } else {
600
- t26 = $[96];
601
- }
602
- const t27 = behindLatest || showJumpToBottomButton;
603
- let t28;
604
- if ($[97] !== jumpToLatest || $[98] !== t27) {
605
- t28 = /*#__PURE__*/_jsx(JumpToBottomButton, {
606
- onPress: jumpToLatest,
607
- visible: t27
446
+ $[59] = anchorMessageId;
447
+ $[60] = behind;
448
+ $[61] = conversation;
449
+ $[62] = conversation_id;
450
+ $[63] = fetchNewer;
451
+ $[64] = fetchNextPage;
452
+ $[65] = hasNextPage;
453
+ $[66] = messages;
454
+ $[67] = noMessages;
455
+ $[68] = onContentSizeChange;
456
+ $[69] = onLayout;
457
+ $[70] = onMomentumScrollEnd;
458
+ $[71] = onScrollEndDrag;
459
+ $[72] = reply_root_id;
460
+ $[73] = styles.emptyState;
461
+ $[74] = t20;
462
+ } else {
463
+ t20 = $[74];
464
+ }
465
+ let t21;
466
+ if ($[75] !== behind || $[76] !== handleReturnToBottom || $[77] !== returnToLatest) {
467
+ t21 = () => behind ? returnToLatest().catch(logWindowFetchFailure) : handleReturnToBottom();
468
+ $[75] = behind;
469
+ $[76] = handleReturnToBottom;
470
+ $[77] = returnToLatest;
471
+ $[78] = t21;
472
+ } else {
473
+ t21 = $[78];
474
+ }
475
+ const t22 = showJumpToBottomButton || behind;
476
+ let t23;
477
+ if ($[79] !== t21 || $[80] !== t22) {
478
+ t23 = /*#__PURE__*/_jsx(JumpToBottomButton, {
479
+ onPress: t21,
480
+ visible: t22
608
481
  });
609
- $[97] = jumpToLatest;
610
- $[98] = t27;
611
- $[99] = t28;
482
+ $[79] = t21;
483
+ $[80] = t22;
484
+ $[81] = t23;
612
485
  } else {
613
- t28 = $[99];
486
+ t23 = $[81];
614
487
  }
615
- let t29;
616
- if ($[100] !== noMessages) {
617
- t29 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
618
- $[100] = noMessages;
619
- $[101] = t29;
488
+ let t24;
489
+ if ($[82] !== noMessages) {
490
+ t24 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
491
+ $[82] = noMessages;
492
+ $[83] = t24;
620
493
  } else {
621
- t29 = $[101];
494
+ t24 = $[83];
622
495
  }
623
- let t30;
624
- if ($[102] !== showLeaderDisabledReplyBanner) {
625
- t30 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
626
- $[102] = showLeaderDisabledReplyBanner;
627
- $[103] = t30;
496
+ let t25;
497
+ if ($[84] !== showLeaderDisabledReplyBanner) {
498
+ t25 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
499
+ $[84] = showLeaderDisabledReplyBanner;
500
+ $[85] = t25;
628
501
  } else {
629
- t30 = $[103];
502
+ t25 = $[85];
630
503
  }
631
- let t31;
632
- if ($[104] !== canReply || $[105] !== conversation || $[106] !== currentlyEditingMessage || $[107] !== jumpToLatest || $[108] !== markHandledByMessageForm || $[109] !== replyRootAuthorFirstName || $[110] !== reply_root_id) {
633
- t31 = /*#__PURE__*/_jsx(ConversationBottomBar, {
504
+ let t26;
505
+ if ($[86] !== canReply || $[87] !== conversation || $[88] !== currentlyEditingMessage || $[89] !== markHandledByMessageForm || $[90] !== replyRootAuthorFirstName || $[91] !== reply_root_id || $[92] !== returnToLatest) {
506
+ t26 = /*#__PURE__*/_jsx(ConversationBottomBar, {
634
507
  conversation: conversation,
635
508
  canReply: canReply,
636
509
  replyRootAuthorFirstName: replyRootAuthorFirstName,
637
510
  replyRootId: reply_root_id,
638
511
  currentlyEditingMessage: currentlyEditingMessage,
639
512
  onFlaggedInMessageForm: markHandledByMessageForm,
640
- onBeforeSubmit: jumpToLatest
513
+ onBeforeSubmit: returnToLatest
641
514
  });
642
- $[104] = canReply;
643
- $[105] = conversation;
644
- $[106] = currentlyEditingMessage;
645
- $[107] = jumpToLatest;
646
- $[108] = markHandledByMessageForm;
647
- $[109] = replyRootAuthorFirstName;
648
- $[110] = reply_root_id;
649
- $[111] = t31;
650
- } else {
651
- t31 = $[111];
652
- }
653
- let t32;
654
- if ($[112] !== t26 || $[113] !== t28 || $[114] !== t29 || $[115] !== t30 || $[116] !== t31) {
655
- t32 = /*#__PURE__*/_jsxs(KeyboardView, {
656
- children: [t26, t28, t29, t30, t31]
515
+ $[86] = canReply;
516
+ $[87] = conversation;
517
+ $[88] = currentlyEditingMessage;
518
+ $[89] = markHandledByMessageForm;
519
+ $[90] = replyRootAuthorFirstName;
520
+ $[91] = reply_root_id;
521
+ $[92] = returnToLatest;
522
+ $[93] = t26;
523
+ } else {
524
+ t26 = $[93];
525
+ }
526
+ let t27;
527
+ if ($[94] !== t20 || $[95] !== t23 || $[96] !== t24 || $[97] !== t25 || $[98] !== t26) {
528
+ t27 = /*#__PURE__*/_jsxs(KeyboardView, {
529
+ children: [t20, t23, t24, t25, t26]
657
530
  });
658
- $[112] = t26;
659
- $[113] = t28;
660
- $[114] = t29;
661
- $[115] = t30;
662
- $[116] = t31;
663
- $[117] = t32;
664
- } else {
665
- t32 = $[117];
666
- }
667
- let t33;
668
- if ($[118] !== styles.container || $[119] !== t32) {
669
- t33 = /*#__PURE__*/_jsx(View, {
531
+ $[94] = t20;
532
+ $[95] = t23;
533
+ $[96] = t24;
534
+ $[97] = t25;
535
+ $[98] = t26;
536
+ $[99] = t27;
537
+ } else {
538
+ t27 = $[99];
539
+ }
540
+ let t28;
541
+ if ($[100] !== styles.container || $[101] !== t27) {
542
+ t28 = /*#__PURE__*/_jsx(View, {
670
543
  style: styles.container,
671
- children: t32
544
+ children: t27
672
545
  });
673
- $[118] = styles.container;
674
- $[119] = t32;
675
- $[120] = t33;
546
+ $[100] = styles.container;
547
+ $[101] = t27;
548
+ $[102] = t28;
676
549
  } else {
677
- t33 = $[120];
550
+ t28 = $[102];
678
551
  }
679
- return t33;
552
+ return t28;
553
+ }
554
+ function _temp(error) {
555
+ return Log.error("conversation window fetch failed", error);
680
556
  }
681
557
  function ConversationBottomBar(t0) {
682
558
  const $ = _c(16);
@@ -760,7 +636,6 @@ function ConversationBottomBar(t0) {
760
636
  }
761
637
  return t6;
762
638
  }
763
- const isBeforeLatestMessage = (anchor, latestMessageCreatedAt) => !!anchor && !!latestMessageCreatedAt && decodeUlidTime(anchor) < Date.parse(latestMessageCreatedAt);
764
639
  export const ConversationScreenTitle = t0 => {
765
640
  const $ = _c(29);
766
641
  const {
@@ -980,7 +855,7 @@ const useEnsureConversationsRouteExists = () => {
980
855
  t0 = () => {
981
856
  const navigationState = navigation.getState();
982
857
  const routes = navigationState?.routes || [];
983
- const conversationsRoute = routes.find(_temp);
858
+ const conversationsRoute = routes.find(_temp2);
984
859
  if (conversationsRoute) {
985
860
  return;
986
861
  }
@@ -1013,7 +888,7 @@ const useEnsureConversationsRouteExists = () => {
1013
888
  }
1014
889
  useEffect(t0, t2);
1015
890
  };
1016
- function _temp(r) {
891
+ function _temp2(r) {
1017
892
  return r.name === "Conversations";
1018
893
  }
1019
894
  //# sourceMappingURL=conversation_screen.js.map