@planningcenter/chat-react-native 4.5.1-qa-staging.11 → 4.5.1-qa-1062.0
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.
- package/build/components/conversation/message_list.js +123 -155
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/components/conversations/conversations.js +0 -1
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/display/conversation_avatar.js +66 -77
- package/build/components/display/conversation_avatar.js.map +1 -1
- package/build/components/display/image.js +44 -47
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/keyboard_scroll_view.js +0 -1
- package/build/components/display/keyboard_scroll_view.js.map +1 -1
- package/build/components/page/page_error_boundary.js +31 -56
- package/build/components/page/page_error_boundary.js.map +1 -1
- package/build/contexts/api_provider.js +5 -11
- package/build/contexts/api_provider.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_conversation_avatar_update.js +48 -146
- package/build/hooks/use_conversation_avatar_update.js.map +1 -1
- package/build/navigation/index.js +1 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.js +6 -10
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +0 -1
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/avatar_picker/avatar_picker_screen.js +66 -76
- package/build/screens/avatar_picker/avatar_picker_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.js +0 -1
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.js +0 -1
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +0 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +291 -332
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +0 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +0 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/get_help_screen.js +62 -56
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.js +2 -3
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/notification_settings_screen.js +0 -1
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +39 -45
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/search/components/search_results_list.js +110 -136
- package/build/screens/search/components/search_results_list.js.map +1 -1
- package/build/screens/search/search_screen.js +28 -21
- package/build/screens/search/search_screen.js.map +1 -1
- package/build/screens/settings_screen.js +6 -7
- package/build/screens/settings_screen.js.map +1 -1
- package/build/screens/system_message_people_screen.js +96 -33
- package/build/screens/system_message_people_screen.js.map +1 -1
- package/package.json +12 -8
- package/src/__tests__/utils/theme.ts +5 -2
- package/src/components/conversation/__tests__/message_list.test.tsx +0 -4
- package/src/components/conversation/message_list.tsx +0 -6
- package/src/components/conversations/__tests__/conversation_preview.test.tsx +2 -2
- package/src/components/conversations/conversations.tsx +0 -1
- package/src/components/display/conversation_avatar.tsx +2 -9
- package/src/components/display/image.tsx +19 -10
- package/src/components/display/keyboard_scroll_view.tsx +0 -1
- package/src/components/page/__tests__/page_error_boundary.test.tsx +0 -33
- package/src/components/page/page_error_boundary.tsx +12 -43
- package/src/contexts/api_provider.tsx +5 -12
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use_conversation_avatar_update.ts +11 -67
- package/src/navigation/index.tsx +2 -6
- package/src/navigation/screenLayout.tsx +1 -3
- package/src/screens/age_check/age_check_required_screen.tsx +1 -5
- package/src/screens/avatar_picker/avatar_picker_screen.tsx +1 -7
- package/src/screens/conversation_details_screen.tsx +0 -1
- package/src/screens/conversation_new/components/form_list.tsx +0 -1
- package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +1 -4
- package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +68 -78
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +0 -1
- package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +0 -1
- package/src/screens/get_help_screen.tsx +4 -4
- package/src/screens/group_notification_settings_screen.tsx +3 -3
- package/src/screens/notification_settings_screen.tsx +0 -1
- package/src/screens/preferred_app_selection_screen.tsx +4 -4
- package/src/screens/search/__tests__/search_screen.test.tsx +12 -11
- package/src/screens/search/components/__tests__/conversation_results.test.tsx +5 -14
- package/src/screens/search/components/__tests__/message_result_row.test.tsx +4 -5
- package/src/screens/search/components/__tests__/search_results_list.test.tsx +5 -10
- package/src/screens/search/components/search_results_list.tsx +13 -34
- package/src/screens/search/search_screen.tsx +18 -8
- package/src/screens/settings_screen.tsx +25 -25
- package/src/screens/system_message_people_screen.tsx +20 -6
- package/build/components/conversation/attachments/attachment_card.d.ts +0 -9
- package/build/components/conversation/attachments/attachment_card.d.ts.map +0 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts +0 -2
- package/build/components/conversation/attachments/attachment_deleting_overlay.d.ts.map +0 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts +0 -7
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +0 -1
- package/build/components/conversation/attachments/constants.d.ts +0 -3
- package/build/components/conversation/attachments/constants.d.ts.map +0 -1
- package/build/components/conversation/attachments/expanded_link.d.ts +0 -6
- package/build/components/conversation/attachments/expanded_link.d.ts.map +0 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +0 -7
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +0 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts +0 -6
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +0 -1
- package/build/components/conversation/attachments/image_attachment.d.ts +0 -14
- package/build/components/conversation/attachments/image_attachment.d.ts.map +0 -1
- package/build/components/conversation/attachments/video_attachment.d.ts +0 -7
- package/build/components/conversation/attachments/video_attachment.d.ts.map +0 -1
- package/build/components/conversation/conversation_start_banner.d.ts +0 -9
- package/build/components/conversation/conversation_start_banner.d.ts.map +0 -1
- package/build/components/conversation/empty_conversation_blank_state.d.ts +0 -2
- package/build/components/conversation/empty_conversation_blank_state.d.ts.map +0 -1
- package/build/components/conversation/jump_to_bottom_button.d.ts +0 -7
- package/build/components/conversation/jump_to_bottom_button.d.ts.map +0 -1
- package/build/components/conversation/message.d.ts +0 -17
- package/build/components/conversation/message.d.ts.map +0 -1
- package/build/components/conversation/message_attachments.d.ts +0 -9
- package/build/components/conversation/message_attachments.d.ts.map +0 -1
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts +0 -10
- package/build/components/conversation/message_form/message_form_attachment_file.d.ts.map +0 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts +0 -12
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +0 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts +0 -9
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +0 -1
- package/build/components/conversation/message_form.d.ts +0 -24
- package/build/components/conversation/message_form.d.ts.map +0 -1
- package/build/components/conversation/message_list.d.ts +0 -24
- package/build/components/conversation/message_list.d.ts.map +0 -1
- package/build/components/conversation/message_markdown.d.ts +0 -6
- package/build/components/conversation/message_markdown.d.ts.map +0 -1
- package/build/components/conversation/message_reaction.d.ts +0 -34
- package/build/components/conversation/message_reaction.d.ts.map +0 -1
- package/build/components/conversation/message_read_receipts.d.ts +0 -6
- package/build/components/conversation/message_read_receipts.d.ts.map +0 -1
- package/build/components/conversation/messages_disabled_banners.d.ts +0 -14
- package/build/components/conversation/messages_disabled_banners.d.ts.map +0 -1
- package/build/components/conversation/missing_message.d.ts +0 -2
- package/build/components/conversation/missing_message.d.ts.map +0 -1
- package/build/components/conversation/reply_connectors.d.ts +0 -10
- package/build/components/conversation/reply_connectors.d.ts.map +0 -1
- package/build/components/conversation/reply_shadow_message.d.ts +0 -12
- package/build/components/conversation/reply_shadow_message.d.ts.map +0 -1
- package/build/components/conversation/system_message.d.ts +0 -9
- package/build/components/conversation/system_message.d.ts.map +0 -1
- package/build/components/conversation/typing_indicator.d.ts +0 -6
- package/build/components/conversation/typing_indicator.d.ts.map +0 -1
- package/build/components/conversations/archived_results_footer.d.ts +0 -6
- package/build/components/conversations/archived_results_footer.d.ts.map +0 -1
- package/build/components/conversations/conversation_actions.d.ts +0 -11
- package/build/components/conversations/conversation_actions.d.ts.map +0 -1
- package/build/components/conversations/conversation_preview.d.ts +0 -12
- package/build/components/conversations/conversation_preview.d.ts.map +0 -1
- package/build/components/conversations/conversations.d.ts +0 -7
- package/build/components/conversations/conversations.d.ts.map +0 -1
- package/build/components/conversations/conversations_blank_state.d.ts +0 -7
- package/build/components/conversations/conversations_blank_state.d.ts.map +0 -1
- package/build/components/conversations/filtered_results_footer.d.ts +0 -2
- package/build/components/conversations/filtered_results_footer.d.ts.map +0 -1
- package/build/components/conversations/mute_indicator.d.ts +0 -4
- package/build/components/conversations/mute_indicator.d.ts.map +0 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +0 -20
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +0 -1
- package/build/components/conversations/unread_count_badge.d.ts +0 -6
- package/build/components/conversations/unread_count_badge.d.ts.map +0 -1
- package/build/components/display/action_button.d.ts +0 -15
- package/build/components/display/action_button.d.ts.map +0 -1
- package/build/components/display/adult_requirement_notice.d.ts +0 -7
- package/build/components/display/adult_requirement_notice.d.ts.map +0 -1
- package/build/components/display/avatar.d.ts +0 -15
- package/build/components/display/avatar.d.ts.map +0 -1
- package/build/components/display/avatar_group.d.ts +0 -14
- package/build/components/display/avatar_group.d.ts.map +0 -1
- package/build/components/display/badge.d.ts +0 -55
- package/build/components/display/badge.d.ts.map +0 -1
- package/build/components/display/banner.d.ts +0 -38
- package/build/components/display/banner.d.ts.map +0 -1
- package/build/components/display/banner_collapsible.d.ts +0 -11
- package/build/components/display/banner_collapsible.d.ts.map +0 -1
- package/build/components/display/button.d.ts +0 -67
- package/build/components/display/button.d.ts.map +0 -1
- package/build/components/display/child_notice.d.ts +0 -10
- package/build/components/display/child_notice.d.ts.map +0 -1
- package/build/components/display/conversation_avatar.d.ts +0 -17
- package/build/components/display/conversation_avatar.d.ts.map +0 -1
- package/build/components/display/emoji_avatar.d.ts +0 -11
- package/build/components/display/emoji_avatar.d.ts.map +0 -1
- package/build/components/display/file_attachment_preview.d.ts +0 -11
- package/build/components/display/file_attachment_preview.d.ts.map +0 -1
- package/build/components/display/filter_dropdown.d.ts +0 -36
- package/build/components/display/filter_dropdown.d.ts.map +0 -1
- package/build/components/display/heading.d.ts +0 -10
- package/build/components/display/heading.d.ts.map +0 -1
- package/build/components/display/icon.d.ts +0 -64
- package/build/components/display/icon.d.ts.map +0 -1
- package/build/components/display/icon_avatar.d.ts +0 -11
- package/build/components/display/icon_avatar.d.ts.map +0 -1
- package/build/components/display/icon_button.d.ts +0 -56
- package/build/components/display/icon_button.d.ts.map +0 -1
- package/build/components/display/icon_tile.d.ts +0 -13
- package/build/components/display/icon_tile.d.ts.map +0 -1
- package/build/components/display/image.d.ts +0 -39
- package/build/components/display/image.d.ts.map +0 -1
- package/build/components/display/image_attachment_preview.d.ts +0 -13
- package/build/components/display/image_attachment_preview.d.ts.map +0 -1
- package/build/components/display/index.d.ts +0 -34
- package/build/components/display/index.d.ts.map +0 -1
- package/build/components/display/keyboard_scroll_view.d.ts +0 -5
- package/build/components/display/keyboard_scroll_view.d.ts.map +0 -1
- package/build/components/display/keyboard_view.d.ts +0 -5
- package/build/components/display/keyboard_view.d.ts.map +0 -1
- package/build/components/display/person.d.ts +0 -9
- package/build/components/display/person.d.ts.map +0 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +0 -61
- package/build/components/display/platform_modal_header_buttons.d.ts.map +0 -1
- package/build/components/display/popover_menu_view.d.ts +0 -8
- package/build/components/display/popover_menu_view.d.ts.map +0 -1
- package/build/components/display/pressable_row.d.ts +0 -14
- package/build/components/display/pressable_row.d.ts.map +0 -1
- package/build/components/display/spinner.d.ts +0 -22
- package/build/components/display/spinner.d.ts.map +0 -1
- package/build/components/display/switch.d.ts +0 -3
- package/build/components/display/switch.d.ts.map +0 -1
- package/build/components/display/tabs.d.ts +0 -17
- package/build/components/display/tabs.d.ts.map +0 -1
- package/build/components/display/text.d.ts +0 -25
- package/build/components/display/text.d.ts.map +0 -1
- package/build/components/display/text_button.d.ts +0 -39
- package/build/components/display/text_button.d.ts.map +0 -1
- package/build/components/display/text_inline_button.d.ts +0 -11
- package/build/components/display/text_inline_button.d.ts.map +0 -1
- package/build/components/display/text_input.d.ts +0 -8
- package/build/components/display/text_input.d.ts.map +0 -1
- package/build/components/display/toggle_button.d.ts +0 -55
- package/build/components/display/toggle_button.d.ts.map +0 -1
- package/build/components/display/utils/avatar_gradient_colors.d.ts +0 -17
- package/build/components/display/utils/avatar_gradient_colors.d.ts.map +0 -1
- package/build/components/display/utils/button_colors.d.ts +0 -39
- package/build/components/display/utils/button_colors.d.ts.map +0 -1
- package/build/components/display/utils/status_colors.d.ts +0 -17
- package/build/components/display/utils/status_colors.d.ts.map +0 -1
- package/build/components/display/version_footer.d.ts +0 -2
- package/build/components/display/version_footer.d.ts.map +0 -1
- package/build/components/display/video_attachment_preview.d.ts +0 -11
- package/build/components/display/video_attachment_preview.d.ts.map +0 -1
- package/build/components/group_conversation_list.d.ts +0 -23
- package/build/components/group_conversation_list.d.ts.map +0 -1
- package/build/components/index.d.ts +0 -7
- package/build/components/index.d.ts.map +0 -1
- package/build/components/page/component_error_boundary.d.ts +0 -4
- package/build/components/page/component_error_boundary.d.ts.map +0 -1
- package/build/components/page/error_boundary.d.ts +0 -20
- package/build/components/page/error_boundary.d.ts.map +0 -1
- package/build/components/page/loading.d.ts +0 -2
- package/build/components/page/loading.d.ts.map +0 -1
- package/build/components/page/page_error_boundary.d.ts +0 -12
- package/build/components/page/page_error_boundary.d.ts.map +0 -1
- package/build/components/primitive/avatar_primitive.d.ts +0 -51
- package/build/components/primitive/avatar_primitive.d.ts.map +0 -1
- package/build/components/primitive/banner_primitive.d.ts +0 -48
- package/build/components/primitive/banner_primitive.d.ts.map +0 -1
- package/build/components/primitive/blank_state_primitive.d.ts +0 -41
- package/build/components/primitive/blank_state_primitive.d.ts.map +0 -1
- package/build/components/primitive/form_sheet.d.ts +0 -75
- package/build/components/primitive/form_sheet.d.ts.map +0 -1
- package/build/components/safe_area_modal.d.ts +0 -7
- package/build/components/safe_area_modal.d.ts.map +0 -1
- package/build/contexts/api_provider.d.ts +0 -7
- package/build/contexts/api_provider.d.ts.map +0 -1
- package/build/contexts/chat_context.d.ts +0 -37
- package/build/contexts/chat_context.d.ts.map +0 -1
- package/build/contexts/conversation_context.d.ts +0 -13
- package/build/contexts/conversation_context.d.ts.map +0 -1
- package/build/contexts/conversations_context.d.ts +0 -16
- package/build/contexts/conversations_context.d.ts.map +0 -1
- package/build/contexts/session_context.d.ts +0 -44
- package/build/contexts/session_context.d.ts.map +0 -1
- package/build/hooks/attachments/fallback_chat_configuration.d.ts +0 -5
- package/build/hooks/attachments/fallback_chat_configuration.d.ts.map +0 -1
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts +0 -14
- package/build/hooks/direct_messages/find_direct_message_conversation.d.ts.map +0 -1
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts +0 -16
- package/build/hooks/direct_messages/resolve_message_available_members_link.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_direct_message_affiliations.d.ts +0 -6
- package/build/hooks/direct_messages/use_direct_message_affiliations.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_direct_message_candidates.d.ts +0 -4
- package/build/hooks/direct_messages/use_direct_message_candidates.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_direct_message_conversation_validate.d.ts +0 -11
- package/build/hooks/direct_messages/use_direct_message_conversation_validate.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.d.ts +0 -13
- package/build/hooks/direct_messages/use_find_or_create_direct_message_conversation.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_message_available_members.d.ts +0 -6
- package/build/hooks/direct_messages/use_message_available_members.d.ts.map +0 -1
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts +0 -6
- package/build/hooks/direct_messages/use_message_available_members_action.d.ts.map +0 -1
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts +0 -168
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts.map +0 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -232
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +0 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts +0 -10
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +0 -1
- package/build/hooks/index.d.ts +0 -34
- package/build/hooks/index.d.ts.map +0 -1
- package/build/hooks/paginator_meta.d.ts +0 -4
- package/build/hooks/paginator_meta.d.ts.map +0 -1
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts +0 -138
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +0 -1
- package/build/hooks/services/use_services_chat_conversation_payload.d.ts +0 -164
- package/build/hooks/services/use_services_chat_conversation_payload.d.ts.map +0 -1
- package/build/hooks/services/use_services_team.d.ts +0 -4
- package/build/hooks/services/use_services_team.d.ts.map +0 -1
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts +0 -176
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts.map +0 -1
- package/build/hooks/services/use_team_plans.d.ts +0 -17
- package/build/hooks/services/use_team_plans.d.ts.map +0 -1
- package/build/hooks/use_animated_message_background_color.d.ts +0 -9
- package/build/hooks/use_animated_message_background_color.d.ts.map +0 -1
- package/build/hooks/use_api.d.ts +0 -391
- package/build/hooks/use_api.d.ts.map +0 -1
- package/build/hooks/use_api_client.d.ts +0 -7
- package/build/hooks/use_api_client.d.ts.map +0 -1
- package/build/hooks/use_app_name.d.ts +0 -3
- package/build/hooks/use_app_name.d.ts.map +0 -1
- package/build/hooks/use_app_state.d.ts +0 -2
- package/build/hooks/use_app_state.d.ts.map +0 -1
- package/build/hooks/use_async_storage.d.ts +0 -4
- package/build/hooks/use_async_storage.d.ts.map +0 -1
- package/build/hooks/use_at_font_scale_breakpoint.d.ts +0 -2
- package/build/hooks/use_at_font_scale_breakpoint.d.ts.map +0 -1
- package/build/hooks/use_attachment_uploader.d.ts +0 -22
- package/build/hooks/use_attachment_uploader.d.ts.map +0 -1
- package/build/hooks/use_broadcast_typing_status.d.ts +0 -9
- package/build/hooks/use_broadcast_typing_status.d.ts.map +0 -1
- package/build/hooks/use_can_browse_archived_conversations.d.ts +0 -2
- package/build/hooks/use_can_browse_archived_conversations.d.ts.map +0 -1
- package/build/hooks/use_chat_configuration.d.ts +0 -7
- package/build/hooks/use_chat_configuration.d.ts.map +0 -1
- package/build/hooks/use_chat_permissions.d.ts +0 -190
- package/build/hooks/use_chat_permissions.d.ts.map +0 -1
- package/build/hooks/use_clear_conversation_filters.d.ts +0 -2
- package/build/hooks/use_clear_conversation_filters.d.ts.map +0 -1
- package/build/hooks/use_conversation.d.ts +0 -275
- package/build/hooks/use_conversation.d.ts.map +0 -1
- package/build/hooks/use_conversation_avatar_update.d.ts +0 -27
- package/build/hooks/use_conversation_avatar_update.d.ts.map +0 -1
- package/build/hooks/use_conversation_jolt_events.d.ts +0 -6
- package/build/hooks/use_conversation_jolt_events.d.ts.map +0 -1
- package/build/hooks/use_conversation_membership.d.ts +0 -5
- package/build/hooks/use_conversation_membership.d.ts.map +0 -1
- package/build/hooks/use_conversation_message.d.ts +0 -12
- package/build/hooks/use_conversation_message.d.ts.map +0 -1
- package/build/hooks/use_conversation_messages.d.ts +0 -23
- package/build/hooks/use_conversation_messages.d.ts.map +0 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts +0 -6
- package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +0 -1
- package/build/hooks/use_conversation_validate.d.ts +0 -12
- package/build/hooks/use_conversation_validate.d.ts.map +0 -1
- package/build/hooks/use_conversations.d.ts +0 -12
- package/build/hooks/use_conversations.d.ts.map +0 -1
- package/build/hooks/use_conversations_actions.d.ts +0 -221
- package/build/hooks/use_conversations_actions.d.ts.map +0 -1
- package/build/hooks/use_conversations_cache.d.ts +0 -20
- package/build/hooks/use_conversations_cache.d.ts.map +0 -1
- package/build/hooks/use_conversations_jolt_events.d.ts +0 -2
- package/build/hooks/use_conversations_jolt_events.d.ts.map +0 -1
- package/build/hooks/use_create_android_ripple_color.d.ts +0 -4
- package/build/hooks/use_create_android_ripple_color.d.ts.map +0 -1
- package/build/hooks/use_current_person.d.ts +0 -18
- package/build/hooks/use_current_person.d.ts.map +0 -1
- package/build/hooks/use_debounced_search_term.d.ts +0 -2
- package/build/hooks/use_debounced_search_term.d.ts.map +0 -1
- package/build/hooks/use_deleting_ids.d.ts +0 -4
- package/build/hooks/use_deleting_ids.d.ts.map +0 -1
- package/build/hooks/use_direct_message_eligibility.d.ts +0 -14
- package/build/hooks/use_direct_message_eligibility.d.ts.map +0 -1
- package/build/hooks/use_direct_messages_eligible.d.ts +0 -2
- package/build/hooks/use_direct_messages_eligible.d.ts.map +0 -1
- package/build/hooks/use_enrich_people.d.ts +0 -13
- package/build/hooks/use_enrich_people.d.ts.map +0 -1
- package/build/hooks/use_features.d.ts +0 -38
- package/build/hooks/use_features.d.ts.map +0 -1
- package/build/hooks/use_filter_dropdown_enabled.d.ts +0 -2
- package/build/hooks/use_filter_dropdown_enabled.d.ts.map +0 -1
- package/build/hooks/use_font_scale.d.ts +0 -5
- package/build/hooks/use_font_scale.d.ts.map +0 -1
- package/build/hooks/use_giphy.d.ts +0 -9
- package/build/hooks/use_giphy.d.ts.map +0 -1
- package/build/hooks/use_groups.d.ts +0 -214
- package/build/hooks/use_groups.d.ts.map +0 -1
- package/build/hooks/use_groups_groups.d.ts +0 -208
- package/build/hooks/use_groups_groups.d.ts.map +0 -1
- package/build/hooks/use_has_direct_messages.d.ts +0 -2
- package/build/hooks/use_has_direct_messages.d.ts.map +0 -1
- package/build/hooks/use_interaction_tinted_background_color.d.ts +0 -2
- package/build/hooks/use_interaction_tinted_background_color.d.ts.map +0 -1
- package/build/hooks/use_jolt.d.ts +0 -11
- package/build/hooks/use_jolt.d.ts.map +0 -1
- package/build/hooks/use_live_relative_time.d.ts +0 -3
- package/build/hooks/use_live_relative_time.d.ts.map +0 -1
- package/build/hooks/use_manual_archiving_enabled.d.ts +0 -2
- package/build/hooks/use_manual_archiving_enabled.d.ts.map +0 -1
- package/build/hooks/use_mark_latest_message_read.d.ts +0 -9
- package/build/hooks/use_mark_latest_message_read.d.ts.map +0 -1
- package/build/hooks/use_message_create_or_update.d.ts +0 -110
- package/build/hooks/use_message_create_or_update.d.ts.map +0 -1
- package/build/hooks/use_message_draft.d.ts +0 -13
- package/build/hooks/use_message_draft.d.ts.map +0 -1
- package/build/hooks/use_message_reaction_toggle.d.ts +0 -21
- package/build/hooks/use_message_reaction_toggle.d.ts.map +0 -1
- package/build/hooks/use_my_gender.d.ts +0 -7
- package/build/hooks/use_my_gender.d.ts.map +0 -1
- package/build/hooks/use_new_conversation_entry.d.ts +0 -8
- package/build/hooks/use_new_conversation_entry.d.ts.map +0 -1
- package/build/hooks/use_new_conversation_from_filter.d.ts +0 -12
- package/build/hooks/use_new_conversation_from_filter.d.ts.map +0 -1
- package/build/hooks/use_organization.d.ts +0 -39
- package/build/hooks/use_organization.d.ts.map +0 -1
- package/build/hooks/use_people_person.d.ts +0 -18
- package/build/hooks/use_people_person.d.ts.map +0 -1
- package/build/hooks/use_person_settings.d.ts +0 -6
- package/build/hooks/use_person_settings.d.ts.map +0 -1
- package/build/hooks/use_preview_avatar_diameter.d.ts +0 -2
- package/build/hooks/use_preview_avatar_diameter.d.ts.map +0 -1
- package/build/hooks/use_product_analytics.d.ts +0 -24
- package/build/hooks/use_product_analytics.d.ts.map +0 -1
- package/build/hooks/use_qualified_by_age.d.ts +0 -2
- package/build/hooks/use_qualified_by_age.d.ts.map +0 -1
- package/build/hooks/use_read_receipts.d.ts +0 -40
- package/build/hooks/use_read_receipts.d.ts.map +0 -1
- package/build/hooks/use_reduce_motion.d.ts +0 -2
- package/build/hooks/use_reduce_motion.d.ts.map +0 -1
- package/build/hooks/use_report_bug_action.d.ts +0 -6
- package/build/hooks/use_report_bug_action.d.ts.map +0 -1
- package/build/hooks/use_report_message.d.ts +0 -6
- package/build/hooks/use_report_message.d.ts.map +0 -1
- package/build/hooks/use_rest_away_from_dismiss_edge.d.ts +0 -19
- package/build/hooks/use_rest_away_from_dismiss_edge.d.ts.map +0 -1
- package/build/hooks/use_scalable_number_of_lines.d.ts +0 -2
- package/build/hooks/use_scalable_number_of_lines.d.ts.map +0 -1
- package/build/hooks/use_search_enabled.d.ts +0 -2
- package/build/hooks/use_search_enabled.d.ts.map +0 -1
- package/build/hooks/use_search_results.d.ts +0 -19
- package/build/hooks/use_search_results.d.ts.map +0 -1
- package/build/hooks/use_selected_chip_background_color.d.ts +0 -2
- package/build/hooks/use_selected_chip_background_color.d.ts.map +0 -1
- package/build/hooks/use_storage.d.ts +0 -9
- package/build/hooks/use_storage.d.ts.map +0 -1
- package/build/hooks/use_submit_age_check.d.ts +0 -78
- package/build/hooks/use_submit_age_check.d.ts.map +0 -1
- package/build/hooks/use_suspense_api.d.ts +0 -86
- package/build/hooks/use_suspense_api.d.ts.map +0 -1
- package/build/hooks/use_system_message_people.d.ts +0 -14
- package/build/hooks/use_system_message_people.d.ts.map +0 -1
- package/build/hooks/use_system_message_people.js +0 -101
- package/build/hooks/use_system_message_people.js.map +0 -1
- package/build/hooks/use_teams.d.ts +0 -207
- package/build/hooks/use_teams.d.ts.map +0 -1
- package/build/hooks/use_theme.d.ts +0 -3
- package/build/hooks/use_theme.d.ts.map +0 -1
- package/build/hooks/use_typing_indicators.d.ts +0 -13
- package/build/hooks/use_typing_indicators.d.ts.map +0 -1
- package/build/hooks/use_typing_status_cache.d.ts +0 -14
- package/build/hooks/use_typing_status_cache.d.ts.map +0 -1
- package/build/hooks/use_unarchive_conversation_action.d.ts +0 -7
- package/build/hooks/use_unarchive_conversation_action.d.ts.map +0 -1
- package/build/hooks/use_upload_client.d.ts +0 -32
- package/build/hooks/use_upload_client.d.ts.map +0 -1
- package/build/hooks/use_video_moderation_jolt_events.d.ts +0 -4
- package/build/hooks/use_video_moderation_jolt_events.d.ts.map +0 -1
- package/build/icons/font_awesome.d.ts +0 -2
- package/build/icons/font_awesome.d.ts.map +0 -1
- package/build/index.d.ts +0 -20
- package/build/index.d.ts.map +0 -1
- package/build/jest.d.ts +0 -18
- package/build/jest.d.ts.map +0 -1
- package/build/navigation/chat_access_gate.d.ts +0 -3
- package/build/navigation/chat_access_gate.d.ts.map +0 -1
- package/build/navigation/index.d.ts +0 -392
- package/build/navigation/index.d.ts.map +0 -1
- package/build/navigation/page_error_fallbacks.d.ts +0 -7
- package/build/navigation/page_error_fallbacks.d.ts.map +0 -1
- package/build/navigation/page_error_fallbacks.js +0 -7
- package/build/navigation/page_error_fallbacks.js.map +0 -1
- package/build/navigation/screenLayout.d.ts +0 -8
- package/build/navigation/screenLayout.d.ts.map +0 -1
- package/build/polyfills/events/CustomEvent.d.ts +0 -21
- package/build/polyfills/events/CustomEvent.d.ts.map +0 -1
- package/build/polyfills/events/Event.d.ts +0 -45
- package/build/polyfills/events/Event.d.ts.map +0 -1
- package/build/polyfills/events/EventHandlerAttributes.d.ts +0 -8
- package/build/polyfills/events/EventHandlerAttributes.d.ts.map +0 -1
- package/build/polyfills/events/EventTarget.d.ts +0 -30
- package/build/polyfills/events/EventTarget.d.ts.map +0 -1
- package/build/polyfills/events/internals/EventInternals.d.ts +0 -30
- package/build/polyfills/events/internals/EventInternals.d.ts.map +0 -1
- package/build/polyfills/events/internals/EventTargetInternals.d.ts +0 -9
- package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +0 -1
- package/build/polyfills/webidl/PlatformObjects.d.ts +0 -31
- package/build/polyfills/webidl/PlatformObjects.d.ts.map +0 -1
- package/build/screens/age_check/age_check_required_screen.d.ts +0 -2
- package/build/screens/age_check/age_check_required_screen.d.ts.map +0 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts +0 -5
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +0 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts +0 -10
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +0 -1
- package/build/screens/age_check/index.d.ts +0 -3
- package/build/screens/age_check/index.d.ts.map +0 -1
- package/build/screens/age_check/screen_props.d.ts +0 -5
- package/build/screens/age_check/screen_props.d.ts.map +0 -1
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts +0 -12
- package/build/screens/attachment_actions/attachment_actions_screen.d.ts.map +0 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.d.ts +0 -10
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.d.ts.map +0 -1
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts +0 -11
- package/build/screens/avatar_picker/avatar_picker_screen.d.ts.map +0 -1
- package/build/screens/avatar_picker/avatar_picker_state.d.ts +0 -38
- package/build/screens/avatar_picker/avatar_picker_state.d.ts.map +0 -1
- package/build/screens/avatar_picker/avatar_preview.d.ts +0 -9
- package/build/screens/avatar_picker/avatar_preview.d.ts.map +0 -1
- package/build/screens/avatar_picker/color_picker.d.ts +0 -8
- package/build/screens/avatar_picker/color_picker.d.ts.map +0 -1
- package/build/screens/avatar_picker/constants.d.ts +0 -3
- package/build/screens/avatar_picker/constants.d.ts.map +0 -1
- package/build/screens/avatar_picker/emoji_tab.d.ts +0 -6
- package/build/screens/avatar_picker/emoji_tab.d.ts.map +0 -1
- package/build/screens/avatar_picker/icon_grid.d.ts +0 -7
- package/build/screens/avatar_picker/icon_grid.d.ts.map +0 -1
- package/build/screens/avatar_picker/upload_tab.d.ts +0 -8
- package/build/screens/avatar_picker/upload_tab.d.ts.map +0 -1
- package/build/screens/bug_report_screen.d.ts +0 -4
- package/build/screens/bug_report_screen.d.ts.map +0 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts +0 -8
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +0 -1
- package/build/screens/conversation_details_screen.d.ts +0 -6
- package/build/screens/conversation_details_screen.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +0 -11
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +0 -11
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +0 -4
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +0 -10
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +0 -176
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/types.d.ts +0 -48
- package/build/screens/conversation_filter_recipients/types.d.ts.map +0 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts +0 -2
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +0 -1
- package/build/screens/conversation_filters/components/rows.d.ts +0 -42
- package/build/screens/conversation_filters/components/rows.d.ts.map +0 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +0 -27
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +0 -1
- package/build/screens/conversation_filters/filter_types.d.ts +0 -9
- package/build/screens/conversation_filters/filter_types.d.ts.map +0 -1
- package/build/screens/conversation_filters/group_filters.d.ts +0 -5
- package/build/screens/conversation_filters/group_filters.d.ts.map +0 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +0 -415
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +0 -1
- package/build/screens/conversation_filters/screen_props.d.ts +0 -16
- package/build/screens/conversation_filters/screen_props.d.ts.map +0 -1
- package/build/screens/conversation_filters/team_filters.d.ts +0 -5
- package/build/screens/conversation_filters/team_filters.d.ts.map +0 -1
- package/build/screens/conversation_filters_screen.d.ts +0 -5
- package/build/screens/conversation_filters_screen.d.ts.map +0 -1
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts +0 -11
- package/build/screens/conversation_new/components/avatar_selection_row.d.ts.map +0 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts +0 -22
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +0 -1
- package/build/screens/conversation_new/components/form_list.d.ts +0 -13
- package/build/screens/conversation_new/components/form_list.d.ts.map +0 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +0 -9
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +0 -1
- package/build/screens/conversation_new/components/groups_form.d.ts +0 -10
- package/build/screens/conversation_new/components/groups_form.d.ts.map +0 -1
- package/build/screens/conversation_new/components/services_form.d.ts +0 -11
- package/build/screens/conversation_new/components/services_form.d.ts.map +0 -1
- package/build/screens/conversation_new/components/source_app_error_card.d.ts +0 -2
- package/build/screens/conversation_new/components/source_app_error_card.d.ts.map +0 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +0 -18
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +0 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts +0 -7
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +0 -1
- package/build/screens/conversation_screen.d.ts +0 -28
- package/build/screens/conversation_screen.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts +0 -8
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts +0 -11
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts +0 -7
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/results_heading.d.ts +0 -6
- package/build/screens/conversation_select_recipients/components/results_heading.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +0 -8
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts +0 -8
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts +0 -3
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts +0 -3
- package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts +0 -3
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts +0 -3
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +0 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts +0 -11
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +0 -1
- package/build/screens/conversation_select_type_screen.d.ts +0 -12
- package/build/screens/conversation_select_type_screen.d.ts.map +0 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts +0 -4
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +0 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts +0 -2
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +0 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts +0 -19
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +0 -1
- package/build/screens/conversations/components/list_header_component.d.ts +0 -2
- package/build/screens/conversations/components/list_header_component.d.ts.map +0 -1
- package/build/screens/conversations/components/search_list_header_component.d.ts +0 -2
- package/build/screens/conversations/components/search_list_header_component.d.ts.map +0 -1
- package/build/screens/conversations/conversations_screen.d.ts +0 -13
- package/build/screens/conversations/conversations_screen.d.ts.map +0 -1
- package/build/screens/design_system_screen.d.ts +0 -2
- package/build/screens/design_system_screen.d.ts.map +0 -1
- package/build/screens/get_help_screen.d.ts +0 -10
- package/build/screens/get_help_screen.d.ts.map +0 -1
- package/build/screens/group_notification_level_select_screen.d.ts +0 -7
- package/build/screens/group_notification_level_select_screen.d.ts.map +0 -1
- package/build/screens/group_notification_settings_screen.d.ts +0 -7
- package/build/screens/group_notification_settings_screen.d.ts.map +0 -1
- package/build/screens/index.d.ts +0 -25
- package/build/screens/index.d.ts.map +0 -1
- package/build/screens/message_actions_screen.d.ts +0 -12
- package/build/screens/message_actions_screen.d.ts.map +0 -1
- package/build/screens/message_report/components/message_preview.d.ts +0 -9
- package/build/screens/message_report/components/message_preview.d.ts.map +0 -1
- package/build/screens/message_report/components/report_reason_list.d.ts +0 -8
- package/build/screens/message_report/components/report_reason_list.d.ts.map +0 -1
- package/build/screens/message_report_screen.d.ts +0 -9
- package/build/screens/message_report_screen.d.ts.map +0 -1
- package/build/screens/not_found.d.ts +0 -2
- package/build/screens/not_found.d.ts.map +0 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +0 -96
- package/build/screens/notification_settings/hooks/groups.d.ts.map +0 -1
- package/build/screens/notification_settings_screen.d.ts +0 -4
- package/build/screens/notification_settings_screen.d.ts.map +0 -1
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts +0 -39
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts.map +0 -1
- package/build/screens/preferred_app_selection_screen.d.ts +0 -9
- package/build/screens/preferred_app_selection_screen.d.ts.map +0 -1
- package/build/screens/reactions_screen.d.ts +0 -9
- package/build/screens/reactions_screen.d.ts.map +0 -1
- package/build/screens/search/components/conversation_result_row.d.ts +0 -8
- package/build/screens/search/components/conversation_result_row.d.ts.map +0 -1
- package/build/screens/search/components/conversation_results.d.ts +0 -8
- package/build/screens/search/components/conversation_results.d.ts.map +0 -1
- package/build/screens/search/components/message_result_row.d.ts +0 -8
- package/build/screens/search/components/message_result_row.d.ts.map +0 -1
- package/build/screens/search/components/result_row.d.ts +0 -10
- package/build/screens/search/components/result_row.d.ts.map +0 -1
- package/build/screens/search/components/results_section.d.ts +0 -9
- package/build/screens/search/components/results_section.d.ts.map +0 -1
- package/build/screens/search/components/search_blank_states.d.ts +0 -7
- package/build/screens/search/components/search_blank_states.d.ts.map +0 -1
- package/build/screens/search/components/search_field.d.ts +0 -7
- package/build/screens/search/components/search_field.d.ts.map +0 -1
- package/build/screens/search/components/search_results_list.d.ts +0 -16
- package/build/screens/search/components/search_results_list.d.ts.map +0 -1
- package/build/screens/search/components/snippet.d.ts +0 -8
- package/build/screens/search/components/snippet.d.ts.map +0 -1
- package/build/screens/search/search_screen.d.ts +0 -5
- package/build/screens/search/search_screen.d.ts.map +0 -1
- package/build/screens/send_giphy_screen.d.ts +0 -9
- package/build/screens/send_giphy_screen.d.ts.map +0 -1
- package/build/screens/settings_screen.d.ts +0 -4
- package/build/screens/settings_screen.d.ts.map +0 -1
- package/build/screens/system_message_people_screen.d.ts +0 -8
- package/build/screens/system_message_people_screen.d.ts.map +0 -1
- package/build/screens/team_conversation_screen.d.ts +0 -8
- package/build/screens/team_conversation_screen.d.ts.map +0 -1
- package/build/types/api_primitives.d.ts +0 -45
- package/build/types/api_primitives.d.ts.map +0 -1
- package/build/types/index.d.ts +0 -4
- package/build/types/index.d.ts.map +0 -1
- package/build/types/jolt_events/attachment_events.d.ts +0 -14
- package/build/types/jolt_events/attachment_events.d.ts.map +0 -1
- package/build/types/jolt_events/conversation_events.d.ts +0 -42
- package/build/types/jolt_events/conversation_events.d.ts.map +0 -1
- package/build/types/jolt_events/index.d.ts +0 -14
- package/build/types/jolt_events/index.d.ts.map +0 -1
- package/build/types/jolt_events/message_events.d.ts +0 -44
- package/build/types/jolt_events/message_events.d.ts.map +0 -1
- package/build/types/jolt_events/reaction_events.d.ts +0 -27
- package/build/types/jolt_events/reaction_events.d.ts.map +0 -1
- package/build/types/jolt_events/typing_events.d.ts +0 -16
- package/build/types/jolt_events/typing_events.d.ts.map +0 -1
- package/build/types/product_analytics.d.ts +0 -6
- package/build/types/product_analytics.d.ts.map +0 -1
- package/build/types/resources/analytics_metadata.d.ts +0 -5
- package/build/types/resources/analytics_metadata.d.ts.map +0 -1
- package/build/types/resources/app_grant.d.ts +0 -8
- package/build/types/resources/app_grant.d.ts.map +0 -1
- package/build/types/resources/app_name.d.ts +0 -2
- package/build/types/resources/app_name.d.ts.map +0 -1
- package/build/types/resources/chat_configuration_resource.d.ts +0 -9
- package/build/types/resources/chat_configuration_resource.d.ts.map +0 -1
- package/build/types/resources/conversation.d.ts +0 -48
- package/build/types/resources/conversation.d.ts.map +0 -1
- package/build/types/resources/conversation_badge.d.ts +0 -12
- package/build/types/resources/conversation_badge.d.ts.map +0 -1
- package/build/types/resources/conversation_membership.d.ts +0 -16
- package/build/types/resources/conversation_membership.d.ts.map +0 -1
- package/build/types/resources/conversation_validate.d.ts +0 -10
- package/build/types/resources/conversation_validate.d.ts.map +0 -1
- package/build/types/resources/denormalized_attachment_resource.d.ts +0 -65
- package/build/types/resources/denormalized_attachment_resource.d.ts.map +0 -1
- package/build/types/resources/denormalized_attachment_resource_for_create.d.ts +0 -53
- package/build/types/resources/denormalized_attachment_resource_for_create.d.ts.map +0 -1
- package/build/types/resources/direct_message_affiliations.d.ts +0 -9
- package/build/types/resources/direct_message_affiliations.d.ts.map +0 -1
- package/build/types/resources/direct_message_candidate.d.ts +0 -13
- package/build/types/resources/direct_message_candidate.d.ts.map +0 -1
- package/build/types/resources/feature_resource.d.ts +0 -7
- package/build/types/resources/feature_resource.d.ts.map +0 -1
- package/build/types/resources/group_membership.d.ts +0 -13
- package/build/types/resources/group_membership.d.ts.map +0 -1
- package/build/types/resources/group_resource.d.ts +0 -18
- package/build/types/resources/group_resource.d.ts.map +0 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +0 -15
- package/build/types/resources/groups/groups_group_resource.d.ts.map +0 -1
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts +0 -15
- package/build/types/resources/groups/groups_member_resource_with_person.d.ts.map +0 -1
- package/build/types/resources/groups/index.d.ts +0 -2
- package/build/types/resources/groups/index.d.ts.map +0 -1
- package/build/types/resources/index.d.ts +0 -18
- package/build/types/resources/index.d.ts.map +0 -1
- package/build/types/resources/member.d.ts +0 -16
- package/build/types/resources/member.d.ts.map +0 -1
- package/build/types/resources/member_ability.d.ts +0 -12
- package/build/types/resources/member_ability.d.ts.map +0 -1
- package/build/types/resources/message.d.ts +0 -44
- package/build/types/resources/message.d.ts.map +0 -1
- package/build/types/resources/message_report.d.ts +0 -19
- package/build/types/resources/message_report.d.ts.map +0 -1
- package/build/types/resources/oauth_token.d.ts +0 -9
- package/build/types/resources/oauth_token.d.ts.map +0 -1
- package/build/types/resources/organization.d.ts +0 -8
- package/build/types/resources/organization.d.ts.map +0 -1
- package/build/types/resources/person.d.ts +0 -24
- package/build/types/resources/person.d.ts.map +0 -1
- package/build/types/resources/reaction.d.ts +0 -10
- package/build/types/resources/reaction.d.ts.map +0 -1
- package/build/types/resources/read_receipt.d.ts +0 -7
- package/build/types/resources/read_receipt.d.ts.map +0 -1
- package/build/types/resources/search_result.d.ts +0 -29
- package/build/types/resources/search_result.d.ts.map +0 -1
- package/build/types/resources/services/chat_resource.d.ts +0 -53
- package/build/types/resources/services/chat_resource.d.ts.map +0 -1
- package/build/types/resources/services/index.d.ts +0 -3
- package/build/types/resources/services/index.d.ts.map +0 -1
- package/build/types/resources/services/team_resource.d.ts +0 -19
- package/build/types/resources/services/team_resource.d.ts.map +0 -1
- package/build/types/utils/index.d.ts +0 -5
- package/build/types/utils/index.d.ts.map +0 -1
- package/build/utils/archived_conversation.d.ts +0 -5
- package/build/utils/archived_conversation.d.ts.map +0 -1
- package/build/utils/assert_keys_are_numbers.d.ts +0 -2
- package/build/utils/assert_keys_are_numbers.d.ts.map +0 -1
- package/build/utils/attachment_kind.d.ts +0 -5
- package/build/utils/attachment_kind.d.ts.map +0 -1
- package/build/utils/auth_events.d.ts +0 -7
- package/build/utils/auth_events.d.ts.map +0 -1
- package/build/utils/cache/index.d.ts +0 -2
- package/build/utils/cache/index.d.ts.map +0 -1
- package/build/utils/cache/messages_cache.d.ts +0 -13
- package/build/utils/cache/messages_cache.d.ts.map +0 -1
- package/build/utils/cache/messages_window.d.ts +0 -11
- package/build/utils/cache/messages_window.d.ts.map +0 -1
- package/build/utils/cache/optimistically_create_message.d.ts +0 -12
- package/build/utils/cache/optimistically_create_message.d.ts.map +0 -1
- package/build/utils/cache/optimistically_update_message.d.ts +0 -8
- package/build/utils/cache/optimistically_update_message.d.ts.map +0 -1
- package/build/utils/cache/page_mutations.d.ts +0 -96
- package/build/utils/cache/page_mutations.d.ts.map +0 -1
- package/build/utils/can_submit_message.d.ts +0 -10
- package/build/utils/can_submit_message.d.ts.map +0 -1
- package/build/utils/chat_type_label.d.ts +0 -2
- package/build/utils/chat_type_label.d.ts.map +0 -1
- package/build/utils/client/client.d.ts +0 -30
- package/build/utils/client/client.d.ts.map +0 -1
- package/build/utils/client/index.d.ts +0 -3
- package/build/utils/client/index.d.ts.map +0 -1
- package/build/utils/client/instrumented_fetch.d.ts +0 -2
- package/build/utils/client/instrumented_fetch.d.ts.map +0 -1
- package/build/utils/client/request_helpers.d.ts +0 -28
- package/build/utils/client/request_helpers.d.ts.map +0 -1
- package/build/utils/client/transform_request_data.d.ts +0 -13
- package/build/utils/client/transform_request_data.d.ts.map +0 -1
- package/build/utils/client/transform_response.d.ts +0 -3
- package/build/utils/client/transform_response.d.ts.map +0 -1
- package/build/utils/client/types.d.ts +0 -62
- package/build/utils/client/types.d.ts.map +0 -1
- package/build/utils/client/utils.d.ts +0 -5
- package/build/utils/client/utils.d.ts.map +0 -1
- package/build/utils/conversation_safety_constants.d.ts +0 -2
- package/build/utils/conversation_safety_constants.d.ts.map +0 -1
- package/build/utils/convert_attachments_for_create.d.ts +0 -12
- package/build/utils/convert_attachments_for_create.d.ts.map +0 -1
- package/build/utils/date.d.ts +0 -11
- package/build/utils/date.d.ts.map +0 -1
- package/build/utils/dayjs.d.ts +0 -3
- package/build/utils/dayjs.d.ts.map +0 -1
- package/build/utils/deepCamelCaseKeys.d.ts +0 -4
- package/build/utils/deepCamelCaseKeys.d.ts.map +0 -1
- package/build/utils/deep_snake_case_keys.d.ts +0 -4
- package/build/utils/deep_snake_case_keys.d.ts.map +0 -1
- package/build/utils/destructure_chat_group_graph_id.d.ts +0 -10
- package/build/utils/destructure_chat_group_graph_id.d.ts.map +0 -1
- package/build/utils/gender_display_label.d.ts +0 -2
- package/build/utils/gender_display_label.d.ts.map +0 -1
- package/build/utils/generate_placeholder_ulid.d.ts +0 -10
- package/build/utils/generate_placeholder_ulid.d.ts.map +0 -1
- package/build/utils/group_messages.d.ts +0 -22
- package/build/utils/group_messages.d.ts.map +0 -1
- package/build/utils/host_bridge.d.ts +0 -20
- package/build/utils/host_bridge.d.ts.map +0 -1
- package/build/utils/index.d.ts +0 -21
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/is_input_editable.d.ts +0 -6
- package/build/utils/is_input_editable.d.ts.map +0 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts +0 -7
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +0 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts +0 -12
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts.map +0 -1
- package/build/utils/liquid_glass.d.ts +0 -3
- package/build/utils/liquid_glass.d.ts.map +0 -1
- package/build/utils/membership_sync_info_text.d.ts +0 -2
- package/build/utils/membership_sync_info_text.d.ts.map +0 -1
- package/build/utils/message_text.d.ts +0 -3
- package/build/utils/message_text.d.ts.map +0 -1
- package/build/utils/native_adapters/audio.d.ts +0 -14
- package/build/utils/native_adapters/audio.d.ts.map +0 -1
- package/build/utils/native_adapters/clipboard.d.ts +0 -6
- package/build/utils/native_adapters/clipboard.d.ts.map +0 -1
- package/build/utils/native_adapters/configuration.d.ts +0 -36
- package/build/utils/native_adapters/configuration.d.ts.map +0 -1
- package/build/utils/native_adapters/document_picker.d.ts +0 -28
- package/build/utils/native_adapters/document_picker.d.ts.map +0 -1
- package/build/utils/native_adapters/haptic.d.ts +0 -23
- package/build/utils/native_adapters/haptic.d.ts.map +0 -1
- package/build/utils/native_adapters/image_picker.d.ts +0 -31
- package/build/utils/native_adapters/image_picker.d.ts.map +0 -1
- package/build/utils/native_adapters/index.d.ts +0 -12
- package/build/utils/native_adapters/index.d.ts.map +0 -1
- package/build/utils/native_adapters/linking.d.ts +0 -15
- package/build/utils/native_adapters/linking.d.ts.map +0 -1
- package/build/utils/native_adapters/log.d.ts +0 -26
- package/build/utils/native_adapters/log.d.ts.map +0 -1
- package/build/utils/native_adapters/menu.d.ts +0 -40
- package/build/utils/native_adapters/menu.d.ts.map +0 -1
- package/build/utils/native_adapters/storage_adapter.d.ts +0 -17
- package/build/utils/native_adapters/storage_adapter.d.ts.map +0 -1
- package/build/utils/native_adapters/video.d.ts +0 -22
- package/build/utils/native_adapters/video.d.ts.map +0 -1
- package/build/utils/package_version.d.ts +0 -2
- package/build/utils/package_version.d.ts.map +0 -1
- package/build/utils/parse_simple_markdown.d.ts +0 -7
- package/build/utils/parse_simple_markdown.d.ts.map +0 -1
- package/build/utils/performance_tracking.d.ts +0 -26
- package/build/utils/performance_tracking.d.ts.map +0 -1
- package/build/utils/pluralize.d.ts +0 -2
- package/build/utils/pluralize.d.ts.map +0 -1
- package/build/utils/reaction_constants.d.ts +0 -3
- package/build/utils/reaction_constants.d.ts.map +0 -1
- package/build/utils/replace_equal_by_id.d.ts +0 -6
- package/build/utils/replace_equal_by_id.d.ts.map +0 -1
- package/build/utils/request/conversation.d.ts +0 -12
- package/build/utils/request/conversation.d.ts.map +0 -1
- package/build/utils/request/get_chat_configuration.d.ts +0 -10
- package/build/utils/request/get_chat_configuration.d.ts.map +0 -1
- package/build/utils/request/get_features.d.ts +0 -17
- package/build/utils/request/get_features.d.ts.map +0 -1
- package/build/utils/request/get_message.d.ts +0 -20
- package/build/utils/request/get_message.d.ts.map +0 -1
- package/build/utils/request/get_messages.d.ts +0 -21
- package/build/utils/request/get_messages.d.ts.map +0 -1
- package/build/utils/request/get_search_results.d.ts +0 -13
- package/build/utils/request/get_search_results.d.ts.map +0 -1
- package/build/utils/request/messages_data_options.d.ts +0 -7
- package/build/utils/request/messages_data_options.d.ts.map +0 -1
- package/build/utils/response_error.d.ts +0 -11
- package/build/utils/response_error.d.ts.map +0 -1
- package/build/utils/session.d.ts +0 -38
- package/build/utils/session.d.ts.map +0 -1
- package/build/utils/session_manager.d.ts +0 -21
- package/build/utils/session_manager.d.ts.map +0 -1
- package/build/utils/sha_256.d.ts +0 -31
- package/build/utils/sha_256.d.ts.map +0 -1
- package/build/utils/styles.d.ts +0 -11
- package/build/utils/styles.d.ts.map +0 -1
- package/build/utils/system_messages.d.ts +0 -17
- package/build/utils/system_messages.d.ts.map +0 -1
- package/build/utils/theme.d.ts +0 -88
- package/build/utils/theme.d.ts.map +0 -1
- package/build/utils/time.d.ts +0 -9
- package/build/utils/time.d.ts.map +0 -1
- package/build/utils/upload_uri.d.ts +0 -24
- package/build/utils/upload_uri.d.ts.map +0 -1
- package/build/utils/uri.d.ts +0 -29
- package/build/utils/uri.d.ts.map +0 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -53
- package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +0 -1
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts +0 -89
- package/build/vendor/tapestry/alias_tokens_color_map.d.ts.map +0 -1
- package/build/vendor/tapestry/tokens.d.ts +0 -121
- package/build/vendor/tapestry/tokens.d.ts.map +0 -1
- package/src/__utils__/render_with_query_client.tsx +0 -13
- package/src/components/display/__tests__/conversation_avatar.test.tsx +0 -94
- package/src/contexts/__tests__/configured_retry.test.ts +0 -39
- package/src/hooks/__tests__/use_conversation_avatar_update.test.tsx +0 -40
- package/src/hooks/__tests__/use_system_message_people.test.tsx +0 -79
- package/src/hooks/use_system_message_people.ts +0 -55
- package/src/navigation/page_error_fallbacks.ts +0 -14
- package/src/screens/avatar_picker/__tests__/avatar_picker_screen.test.tsx +0 -67
- package/src/screens/conversation_select_recipients/__tests__/conversation_select_direct_message_recipients_screen.test.tsx +0 -100
|
@@ -7,67 +7,47 @@ import { ResponseError } from '../../utils/response_error';
|
|
|
7
7
|
import BlankState from '../primitive/blank_state_primitive';
|
|
8
8
|
import { ErrorBoundary } from './error_boundary';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
10
|
+
const renderPageFallback = (error, reset) => /*#__PURE__*/_jsx(ErrorView, {
|
|
11
|
+
error: error,
|
|
12
|
+
reset: reset
|
|
13
|
+
});
|
|
14
14
|
export function PageErrorBoundary(t0) {
|
|
15
|
-
const $ = _c(
|
|
15
|
+
const $ = _c(6);
|
|
16
16
|
let children;
|
|
17
17
|
let props;
|
|
18
|
-
let t1;
|
|
19
18
|
if ($[0] !== t0) {
|
|
20
19
|
({
|
|
21
20
|
children,
|
|
22
|
-
genericFallback: t1,
|
|
23
21
|
...props
|
|
24
22
|
} = t0);
|
|
25
23
|
$[0] = t0;
|
|
26
24
|
$[1] = children;
|
|
27
25
|
$[2] = props;
|
|
28
|
-
$[3] = t1;
|
|
29
26
|
} else {
|
|
30
27
|
children = $[1];
|
|
31
28
|
props = $[2];
|
|
32
|
-
t1 = $[3];
|
|
33
|
-
}
|
|
34
|
-
const genericFallback = t1 === undefined ? GENERIC_FALLBACK : t1;
|
|
35
|
-
let t2;
|
|
36
|
-
if ($[4] !== genericFallback) {
|
|
37
|
-
t2 = (error, reset) => /*#__PURE__*/_jsx(ErrorView, {
|
|
38
|
-
error: error,
|
|
39
|
-
reset: reset,
|
|
40
|
-
generic: genericFallback
|
|
41
|
-
});
|
|
42
|
-
$[4] = genericFallback;
|
|
43
|
-
$[5] = t2;
|
|
44
|
-
} else {
|
|
45
|
-
t2 = $[5];
|
|
46
29
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
t3 = /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[3] !== children || $[4] !== props) {
|
|
32
|
+
t1 = /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
51
33
|
scope: "screen",
|
|
52
34
|
fallback: renderPageFallback,
|
|
53
35
|
...props,
|
|
54
36
|
children: children
|
|
55
37
|
});
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[9] = t3;
|
|
38
|
+
$[3] = children;
|
|
39
|
+
$[4] = props;
|
|
40
|
+
$[5] = t1;
|
|
60
41
|
} else {
|
|
61
|
-
|
|
42
|
+
t1 = $[5];
|
|
62
43
|
}
|
|
63
|
-
return
|
|
44
|
+
return t1;
|
|
64
45
|
}
|
|
65
46
|
function ErrorView(t0) {
|
|
66
|
-
const $ = _c(
|
|
47
|
+
const $ = _c(11);
|
|
67
48
|
const {
|
|
68
49
|
error,
|
|
69
|
-
reset
|
|
70
|
-
generic
|
|
50
|
+
reset
|
|
71
51
|
} = t0;
|
|
72
52
|
const {
|
|
73
53
|
reset: resetQueries
|
|
@@ -100,45 +80,41 @@ function ErrorView(t0) {
|
|
|
100
80
|
useEffect(t2, t3);
|
|
101
81
|
if (error instanceof ResponseError) {
|
|
102
82
|
let t4;
|
|
103
|
-
if ($[6] !== error.response || $[7] !==
|
|
83
|
+
if ($[6] !== error.response || $[7] !== handleReset) {
|
|
104
84
|
t4 = /*#__PURE__*/_jsx(ResponseErrorView, {
|
|
105
85
|
response: error.response,
|
|
106
|
-
onReset: handleReset
|
|
107
|
-
generic: generic
|
|
86
|
+
onReset: handleReset
|
|
108
87
|
});
|
|
109
88
|
$[6] = error.response;
|
|
110
|
-
$[7] =
|
|
111
|
-
$[8] =
|
|
112
|
-
$[9] = t4;
|
|
89
|
+
$[7] = handleReset;
|
|
90
|
+
$[8] = t4;
|
|
113
91
|
} else {
|
|
114
|
-
t4 = $[
|
|
92
|
+
t4 = $[8];
|
|
115
93
|
}
|
|
116
94
|
return t4;
|
|
117
95
|
}
|
|
118
96
|
if (isNetworkError(error)) {
|
|
119
97
|
let t4;
|
|
120
|
-
if ($[
|
|
98
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
99
|
t4 = /*#__PURE__*/_jsx(ErrorContent, {
|
|
122
100
|
heading: "Problem connecting!",
|
|
123
101
|
body: "Check your internet connection and try again."
|
|
124
102
|
});
|
|
125
|
-
$[
|
|
103
|
+
$[9] = t4;
|
|
126
104
|
} else {
|
|
127
|
-
t4 = $[
|
|
105
|
+
t4 = $[9];
|
|
128
106
|
}
|
|
129
107
|
return t4;
|
|
130
108
|
}
|
|
131
109
|
let t4;
|
|
132
|
-
if ($[
|
|
110
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
133
111
|
t4 = /*#__PURE__*/_jsx(ErrorContent, {
|
|
134
|
-
heading:
|
|
135
|
-
body:
|
|
112
|
+
heading: "Oops!",
|
|
113
|
+
body: "Something unexpected happened."
|
|
136
114
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[12] = generic.heading;
|
|
139
|
-
$[13] = t4;
|
|
115
|
+
$[10] = t4;
|
|
140
116
|
} else {
|
|
141
|
-
t4 = $[
|
|
117
|
+
t4 = $[10];
|
|
142
118
|
}
|
|
143
119
|
return t4;
|
|
144
120
|
}
|
|
@@ -150,8 +126,7 @@ function ResponseErrorView(t0) {
|
|
|
150
126
|
const $ = _c(10);
|
|
151
127
|
const {
|
|
152
128
|
response,
|
|
153
|
-
onReset
|
|
154
|
-
generic
|
|
129
|
+
onReset
|
|
155
130
|
} = t0;
|
|
156
131
|
const {
|
|
157
132
|
status
|
|
@@ -170,7 +145,7 @@ function ResponseErrorView(t0) {
|
|
|
170
145
|
}
|
|
171
146
|
default:
|
|
172
147
|
{
|
|
173
|
-
t1 =
|
|
148
|
+
t1 = "Oops!";
|
|
174
149
|
}
|
|
175
150
|
}
|
|
176
151
|
const heading = t1;
|
|
@@ -188,7 +163,7 @@ function ResponseErrorView(t0) {
|
|
|
188
163
|
}
|
|
189
164
|
default:
|
|
190
165
|
{
|
|
191
|
-
t2 =
|
|
166
|
+
t2 = "Something unexpected happened.";
|
|
192
167
|
}
|
|
193
168
|
}
|
|
194
169
|
const body = t2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_error_boundary.js","names":["useNavigation","useQueryErrorResetBoundary","React","useCallback","useEffect","useMemo","useRef","useState","onAuthRefresh","ResponseError","BlankState","ErrorBoundary","jsx","_jsx","jsxs","_jsxs","GENERIC_FALLBACK","heading","body","PageErrorBoundary","t0","$","_c","children","props","t1","genericFallback","undefined","t2","error","reset","ErrorView","renderPageFallback","t3","scope","generic","resetQueries","handleReset","t4","response","ResponseErrorView","isNetworkError","Symbol","for","ErrorContent","networkFailedMessages","RegExp","join","test","message","onReset","status","bb0","bb1","t5","RateLimitedView","RATE_LIMIT_WINDOW_S","retryAfterS","parseInt","headers","get","String","readyAt","Date","now","current","setNow","id","setInterval","prev","clearInterval","navigation","secondsLeft","Math","max","ceil","Root","Imagery","name","Content","Heading","Text","Button","title","disabled","onPress","size","accessibilityRole","TextButton","goBack","t6","navigate","t7"],"sources":["../../../src/components/page/page_error_boundary.tsx"],"sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { useQueryErrorResetBoundary } from '@tanstack/react-query'\nimport React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { onAuthRefresh } from '../../utils/auth_events'\nimport { ResponseError } from '../../utils/response_error'\nimport BlankState from '../primitive/blank_state_primitive'\nimport { ErrorBoundary, ErrorBoundaryFallback, ErrorBoundaryProps } from './error_boundary'\n\nexport type PageErrorFallback = { heading: string; body: string }\n\nconst GENERIC_FALLBACK: PageErrorFallback = {\n heading: 'Oops!',\n body: 'Something unexpected happened.',\n}\n\ntype PageErrorBoundaryProps = PropsWithChildren<\n ErrorBoundaryProps & { genericFallback?: PageErrorFallback }\n>\n\nexport function PageErrorBoundary({\n children,\n genericFallback = GENERIC_FALLBACK,\n ...props\n}: PageErrorBoundaryProps) {\n const renderPageFallback: ErrorBoundaryFallback = (error, reset) => (\n <ErrorView error={error} reset={reset} generic={genericFallback} />\n )\n\n return (\n <ErrorBoundary scope=\"screen\" fallback={renderPageFallback} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n\nfunction ErrorView({\n error,\n reset,\n generic,\n}: {\n error: Error\n reset: () => void\n generic: PageErrorFallback\n}) {\n const { reset: resetQueries } = useQueryErrorResetBoundary()\n\n const handleReset = useCallback(() => {\n resetQueries()\n reset()\n }, [resetQueries, reset])\n\n useEffect(() => handleReset, [handleReset])\n\n if (error instanceof ResponseError) {\n return <ResponseErrorView response={error.response} onReset={handleReset} generic={generic} />\n }\n\n if (isNetworkError(error)) {\n return (\n <ErrorContent\n heading={'Problem connecting!'}\n body={'Check your internet connection and try again.'}\n />\n )\n }\n\n return <ErrorContent heading={generic.heading} body={generic.body} />\n}\n\nfunction isNetworkError(error: Error) {\n const networkFailedMessages = [\n 'Network request failed',\n 'Network request timed out',\n 'Failed to fetch',\n ]\n\n return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message)\n}\n\nfunction ResponseErrorView({\n response,\n onReset,\n generic,\n}: {\n response: Response\n onReset: () => void\n generic: PageErrorFallback\n}) {\n const { status } = response\n\n const heading = useMemo(() => {\n switch (status) {\n case 403:\n return 'Permission required'\n case 404:\n return 'Content not found'\n default:\n return generic.heading\n }\n }, [status, generic.heading])\n\n const body = useMemo(() => {\n switch (status) {\n case 403:\n return 'Contact your administrator for access.'\n case 404:\n return 'If you believe something should be here, please reach out to your administrator.'\n default:\n return generic.body\n }\n }, [status, generic.body])\n\n useEffect(() => {\n if (status !== 401) return\n\n return onAuthRefresh(onReset)\n }, [status, onReset])\n\n if (status === 429) {\n return <RateLimitedView response={response} onReset={onReset} />\n }\n\n return <ErrorContent heading={heading} body={body} />\n}\n\nconst RATE_LIMIT_WINDOW_S = 20\n\nfunction RateLimitedView({ response, onReset }: { response: Response; onReset: () => void }) {\n const retryAfterS = parseInt(\n response.headers?.get('Retry-After') ?? String(RATE_LIMIT_WINDOW_S),\n 10\n )\n const readyAt = useRef(Date.now() + retryAfterS * 1000).current\n const [now, setNow] = useState(Date.now)\n\n useEffect(() => {\n const id = setInterval(() => {\n setNow(prev => (prev >= readyAt ? prev : Date.now()))\n }, 1000)\n return () => clearInterval(id)\n }, [readyAt])\n\n const navigation = useNavigation()\n const secondsLeft = Math.max(0, Math.ceil((readyAt - now) / 1000))\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>Too many requests</BlankState.Heading>\n <BlankState.Text>\n Chat is being accessed too frequently. Please wait a moment.\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title={secondsLeft > 0 ? `Retry in ${secondsLeft}s` : 'Try again'}\n disabled={secondsLeft > 0}\n onPress={onReset}\n size=\"md\"\n accessibilityRole=\"button\"\n />\n <BlankState.TextButton onPress={navigation.goBack}>Go back</BlankState.TextButton>\n </BlankState.Root>\n )\n}\n\nfunction ErrorContent({ heading, body }: { heading: string; body: string }) {\n const navigation = useNavigation()\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>{heading}</BlankState.Heading>\n <BlankState.Text>{body}</BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Go back\"\n onPress={navigation.goBack}\n size=\"md\"\n accessibilityRole=\"link\"\n />\n <BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>\n Report a bug\n </BlankState.TextButton>\n </BlankState.Root>\n )\n}\n"],"mappings":";AAAA,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,0BAA0B,QAAQ,uBAAuB;AAClE,OAAOC,KAAK,IAAuBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnG,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,OAAOC,UAAU,MAAM,oCAAoC;AAC3D,SAASC,aAAa,QAAmD,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAI3F,MAAMC,gBAAmC,GAAG;EAC1CC,OAAO,EAAE,OAAO;EAChBC,IAAI,EAAE;AACR,CAAC;AAMD,OAAO,SAAAC,kBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAA,IAAAC,QAAA;EAAA,IAAAC,KAAA;EAAA,IAAAC,EAAA;EAAA,IAAAJ,CAAA,QAAAD,EAAA;IAA2B;MAAAG,QAAA;MAAAG,eAAA,EAAAD,EAAA;MAAA,GAAAD;IAAA,IAAAJ,EAIT;IAAAC,CAAA,MAAAD,EAAA;IAAAC,CAAA,MAAAE,QAAA;IAAAF,CAAA,MAAAG,KAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAF,QAAA,GAAAF,CAAA;IAAAG,KAAA,GAAAH,CAAA;IAAAI,EAAA,GAAAJ,CAAA;EAAA;EAFvB,MAAAK,eAAA,GAAAD,EAAkC,KAAlCE,SAAkC,GAAlCX,gBAAkC,GAAlC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C;MAAApE,QAAA,EAAE;IAExE,CAAuB,CAAC;IAAAF,CAAA,OAAAkD,UAAA;IAAAlD,CAAA,OAAAqE,EAAA;EAAA;IAAAA,EAAA,GAAArE,CAAA;EAAA;EAAA,IAAAuE,EAAA;EAAA,IAAAvE,CAAA,SAAAiB,EAAA,IAAAjB,CAAA,SAAAiC,EAAA,IAAAjC,CAAA,SAAAqE,EAAA;IAd1BE,EAAA,gBAAA7E,KAAA,CAAAL,UAAA,CAAAkE,IAAA;MAAArD,QAAA,GACEE,EAAkD,EAClDa,EAGqB,EACrBgB,EAKE,EACFoC,EAEwB;IAAA,CACT,CAAC;IAAArE,CAAA,OAAAiB,EAAA;IAAAjB,CAAA,OAAAiC,EAAA;IAAAjC,CAAA,OAAAqE,EAAA;IAAArE,CAAA,OAAAuE,EAAA;EAAA;IAAAA,EAAA,GAAAvE,CAAA;EAAA;EAAA,OAflBuE,EAekB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"page_error_boundary.js","names":["useNavigation","useQueryErrorResetBoundary","React","useCallback","useEffect","useMemo","useRef","useState","onAuthRefresh","ResponseError","BlankState","ErrorBoundary","jsx","_jsx","jsxs","_jsxs","renderPageFallback","error","reset","ErrorView","PageErrorBoundary","t0","$","_c","children","props","t1","scope","resetQueries","handleReset","t2","t3","t4","response","ResponseErrorView","isNetworkError","Symbol","for","ErrorContent","heading","body","networkFailedMessages","RegExp","join","test","message","onReset","status","bb0","bb1","t5","RateLimitedView","RATE_LIMIT_WINDOW_S","retryAfterS","parseInt","headers","get","String","readyAt","Date","now","current","setNow","id","setInterval","prev","clearInterval","navigation","secondsLeft","Math","max","ceil","Root","Imagery","name","Content","Heading","Text","Button","title","disabled","onPress","size","accessibilityRole","TextButton","goBack","t6","navigate","t7"],"sources":["../../../src/components/page/page_error_boundary.tsx"],"sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { useQueryErrorResetBoundary } from '@tanstack/react-query'\nimport React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { onAuthRefresh } from '../../utils/auth_events'\nimport { ResponseError } from '../../utils/response_error'\nimport BlankState from '../primitive/blank_state_primitive'\nimport { ErrorBoundary, ErrorBoundaryFallback, ErrorBoundaryProps } from './error_boundary'\n\nconst renderPageFallback: ErrorBoundaryFallback = (error, reset) => (\n <ErrorView error={error} reset={reset} />\n)\n\nexport function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>) {\n return (\n <ErrorBoundary scope=\"screen\" fallback={renderPageFallback} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n\nfunction ErrorView({ error, reset }: { error: Error; reset: () => void }) {\n const { reset: resetQueries } = useQueryErrorResetBoundary()\n\n const handleReset = useCallback(() => {\n resetQueries()\n reset()\n }, [resetQueries, reset])\n\n useEffect(() => handleReset, [handleReset])\n\n if (error instanceof ResponseError) {\n return <ResponseErrorView response={error.response} onReset={handleReset} />\n }\n\n if (isNetworkError(error)) {\n return (\n <ErrorContent\n heading={'Problem connecting!'}\n body={'Check your internet connection and try again.'}\n />\n )\n }\n\n return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'} />\n}\n\nfunction isNetworkError(error: Error) {\n const networkFailedMessages = [\n 'Network request failed',\n 'Network request timed out',\n 'Failed to fetch',\n ]\n\n return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message)\n}\n\nfunction ResponseErrorView({ response, onReset }: { response: Response; onReset: () => void }) {\n const { status } = response\n\n const heading = useMemo(() => {\n switch (status) {\n case 403:\n return 'Permission required'\n case 404:\n return 'Content not found'\n default:\n return 'Oops!'\n }\n }, [status])\n\n const body = useMemo(() => {\n switch (status) {\n case 403:\n return 'Contact your administrator for access.'\n case 404:\n return 'If you believe something should be here, please reach out to your administrator.'\n default:\n return 'Something unexpected happened.'\n }\n }, [status])\n\n useEffect(() => {\n if (status !== 401) return\n\n return onAuthRefresh(onReset)\n }, [status, onReset])\n\n if (status === 429) {\n return <RateLimitedView response={response} onReset={onReset} />\n }\n\n return <ErrorContent heading={heading} body={body} />\n}\n\nconst RATE_LIMIT_WINDOW_S = 20\n\nfunction RateLimitedView({ response, onReset }: { response: Response; onReset: () => void }) {\n const retryAfterS = parseInt(\n response.headers?.get('Retry-After') ?? String(RATE_LIMIT_WINDOW_S),\n 10\n )\n const readyAt = useRef(Date.now() + retryAfterS * 1000).current\n const [now, setNow] = useState(Date.now)\n\n useEffect(() => {\n const id = setInterval(() => {\n setNow(prev => (prev >= readyAt ? prev : Date.now()))\n }, 1000)\n return () => clearInterval(id)\n }, [readyAt])\n\n const navigation = useNavigation()\n const secondsLeft = Math.max(0, Math.ceil((readyAt - now) / 1000))\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>Too many requests</BlankState.Heading>\n <BlankState.Text>\n Chat is being accessed too frequently. Please wait a moment.\n </BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title={secondsLeft > 0 ? `Retry in ${secondsLeft}s` : 'Try again'}\n disabled={secondsLeft > 0}\n onPress={onReset}\n size=\"md\"\n accessibilityRole=\"button\"\n />\n <BlankState.TextButton onPress={navigation.goBack}>Go back</BlankState.TextButton>\n </BlankState.Root>\n )\n}\n\nfunction ErrorContent({ heading, body }: { heading: string; body: string }) {\n const navigation = useNavigation()\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>{heading}</BlankState.Heading>\n <BlankState.Text>{body}</BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Go back\"\n onPress={navigation.goBack}\n size=\"md\"\n accessibilityRole=\"link\"\n />\n <BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>\n Report a bug\n </BlankState.TextButton>\n </BlankState.Root>\n )\n}\n"],"mappings":";AAAA,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,0BAA0B,QAAQ,uBAAuB;AAClE,OAAOC,KAAK,IAAuBC,W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CAAC;MAAA/D,QAAA,EAAE;IAExE,CAAuB,CAAC;IAAAF,CAAA,OAAA6C,UAAA;IAAA7C,CAAA,OAAAgE,EAAA;EAAA;IAAAA,EAAA,GAAAhE,CAAA;EAAA;EAAA,IAAAkE,EAAA;EAAA,IAAAlE,CAAA,SAAAU,EAAA,IAAAV,CAAA,SAAA4B,EAAA,IAAA5B,CAAA,SAAAgE,EAAA;IAd1BE,EAAA,gBAAAzE,KAAA,CAAAL,UAAA,CAAA8D,IAAA;MAAAhD,QAAA,GACEE,EAAkD,EAClDM,EAGqB,EACrBkB,EAKE,EACFoC,EAEwB;IAAA,CACT,CAAC;IAAAhE,CAAA,OAAAU,EAAA;IAAAV,CAAA,OAAA4B,EAAA;IAAA5B,CAAA,OAAAgE,EAAA;IAAAhE,CAAA,OAAAkE,EAAA;EAAA;IAAAA,EAAA,GAAAlE,CAAA;EAAA;EAAA,OAflBkE,EAekB;AAAA","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ import { appGrantsQueryOptions } from '../hooks/use_chat_permissions';
|
|
|
7
7
|
import { featuresQueryOptions } from '../hooks/use_features';
|
|
8
8
|
import { useJoltForegroundPing } from '../hooks/use_jolt';
|
|
9
9
|
import { emitAuthRefresh } from '../utils/auth_events';
|
|
10
|
-
import {
|
|
10
|
+
import { ResponseError } from '../utils/response_error';
|
|
11
11
|
import { ChatContext } from './chat_context';
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
let apiClient;
|
|
@@ -24,18 +24,12 @@ const defaultQueryFn = ({
|
|
|
24
24
|
headers
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
if (
|
|
27
|
+
const configuredRetry = (failureCount, error) => {
|
|
28
|
+
if (is429Error(error)) return false;
|
|
29
29
|
return failureCount < 3;
|
|
30
30
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
return status !== undefined && status >= 400 && status < 500;
|
|
34
|
-
};
|
|
35
|
-
const errorStatus = error => {
|
|
36
|
-
if (error instanceof ResponseError) return error.status;
|
|
37
|
-
if (isResponseLike(error)) return error.status;
|
|
38
|
-
return undefined;
|
|
31
|
+
const is429Error = error => {
|
|
32
|
+
return error instanceof ResponseError && error.status === 429;
|
|
39
33
|
};
|
|
40
34
|
export const chatQueryClient = new QueryClient({
|
|
41
35
|
defaultOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_provider.js","names":["focusManager","QueryClient","QueryClientProvider","usePrefetchQuery","React","useContext","useEffect","useRef","useApiClient","useAppState","appGrantsQueryOptions","featuresQueryOptions","useJoltForegroundPing","emitAuthRefresh","isResponseLike","ResponseError","ChatContext","jsx","_jsx","jsxs","_jsxs","apiClient","defaultQueryFn","queryKey","Error","url","data","headers","app","get","configuredRetry","failureCount","error","isClientError","status","errorStatus","undefined","chatQueryClient","defaultOptions","queries","queryFn","retry","ApiProvider","t0","$","_c","children","token","env","session","t1","sessionChanged","useSessionChanged","client","t2","t3","isFetching","cancelQueries","then","_temp","clear","t4","t5","t6","isAuthenticated","PrefetchQueries","t7","Symbol","for","JoltForegroundPing","t8","invalidateQueries","useFocusManager","appState","setFocused","value","newToken","newEnv","prevToken","prevEnv","usePrevious","isInitialLogin","tokenChanged","Boolean","access_token","envChanged","ref","current"],"sources":["../../src/contexts/api_provider.tsx"],"sourcesContent":["import {\n focusManager,\n QueryClient,\n QueryClientProvider,\n QueryKey,\n usePrefetchQuery,\n} from '@tanstack/react-query'\nimport React, { useContext, useEffect, useRef } from 'react'\nimport { ViewProps } from 'react-native'\nimport { ApiClient, useApiClient } from '../hooks/use_api_client'\nimport { useAppState } from '../hooks/use_app_state'\nimport { appGrantsQueryOptions } from '../hooks/use_chat_permissions'\nimport { featuresQueryOptions } from '../hooks/use_features'\nimport { useJoltForegroundPing } from '../hooks/use_jolt'\nimport { RequestQueryKey } from '../hooks/use_suspense_api'\nimport { emitAuthRefresh } from '../utils/auth_events'\nimport { isResponseLike, ResponseError } from '../utils/response_error'\nimport { ChatContext, ChatContextValue } from './chat_context'\n\nlet apiClient: ApiClient | undefined\n\nconst defaultQueryFn = ({ queryKey }: { queryKey: QueryKey }) => {\n if (!apiClient) {\n throw new Error('No token present')\n }\n\n const [url, data, headers, app = 'chat'] = queryKey as RequestQueryKey\n\n return apiClient[app].get({ url, data, headers })\n}\n\nexport const configuredRetry = (failureCount: number, error: unknown) => {\n if (isClientError(error)) return false\n\n return failureCount < 3\n}\n\nconst isClientError = (error: unknown): boolean => {\n const status = errorStatus(error)\n return status !== undefined && status >= 400 && status < 500\n}\n\nconst errorStatus = (error: unknown): number | undefined => {\n if (error instanceof ResponseError) return error.status\n if (isResponseLike(error)) return error.status\n return undefined\n}\n\nexport const chatQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n queryFn: defaultQueryFn,\n retry: configuredRetry,\n },\n },\n})\n\nexport function ApiProvider({ children }: ViewProps) {\n const { token, env, session } = useContext(ChatContext)\n const sessionChanged = useSessionChanged({ token, env })\n\n const client = useApiClient()\n\n useEffect(() => {\n if (!sessionChanged) return\n\n emitAuthRefresh()\n\n if (chatQueryClient.isFetching()) {\n chatQueryClient.cancelQueries().then(() => chatQueryClient.invalidateQueries())\n return\n }\n\n chatQueryClient.clear()\n }, [sessionChanged])\n\n useEffect(() => {\n apiClient = client\n }, [client])\n\n return (\n <QueryClientProvider client={chatQueryClient}>\n {session.isAuthenticated && <PrefetchQueries />}\n <JoltForegroundPing />\n {children}\n </QueryClientProvider>\n )\n}\n\n// Component to prefetch queries when the app is focused\n// This needs to live in the provider so that it can access the api client\n// and the chat query client\nconst PrefetchQueries = () => {\n const client = useApiClient()\n\n usePrefetchQuery(appGrantsQueryOptions(client))\n usePrefetchQuery(featuresQueryOptions(client))\n\n return null\n}\n\nconst JoltForegroundPing = () => {\n useJoltForegroundPing()\n\n return null\n}\n\nexport function useFocusManager() {\n const appState = useAppState()\n\n useEffect(() => {\n focusManager.setFocused(appState === 'active')\n }, [appState])\n\n return appState\n}\n\nfunction useSessionChanged(value: Pick<ChatContextValue, 'token' | 'env'>): boolean {\n const { token: newToken, env: newEnv } = value\n const { token: prevToken, env: prevEnv } = usePrevious<typeof value>(value)\n\n const isInitialLogin = !prevToken && !!newToken\n if (isInitialLogin) return false\n\n const tokenChanged = Boolean(\n prevToken?.access_token && newToken?.access_token !== prevToken?.access_token\n )\n\n const envChanged = Boolean(prevEnv && newEnv !== prevEnv)\n\n return tokenChanged || envChanged\n}\n\nfunction usePrevious<T>(value: T): T {\n const ref = useRef<T>(value)\n\n useEffect(() => {\n ref.current = value\n }, [value])\n\n return ref.current\n}\n"],"mappings":";AAAA,SACEA,YAAY,EACZC,WAAW,EACXC,mBAAmB,EAEnBC,gBAAgB,QACX,uBAAuB;AAC9B,OAAOC,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAE5D,SAAoBC,YAAY,QAAQ,yBAAyB;AACjE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,qBAAqB,QAAQ,mBAAmB;AAEzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,cAAc,EAAEC,aAAa,QAAQ,yBAAyB;AACvE,SAASC,WAAW,QAA0B,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9D,IAAIC,SAAgC;AAEpC,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAiC,CAAC,KAAK;EAC/D,IAAI,CAACF,SAAS,EAAE;IACd,MAAM,IAAIG,KAAK,CAAC,kBAAkB,CAAC;EACrC;EAEA,MAAM,CAACC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,GAAG,MAAM,CAAC,GAAGL,QAA2B;EAEtE,OAAOF,SAAS,CAACO,GAAG,CAAC,CAACC,GAAG,CAAC;IAAEJ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B,IAAlBF,MAAM,KAAKE,OAAO,CAAC;EAAA,OAElDG,YAA0B,IAA1BG,UAA0B;AAAA;AAGnC,SAASL,WAAWA,CAAIL,KAAQ,EAAK;EACnC,MAAMW,GAAG,GAAG/E,MAAM,CAAIoE,KAAK,CAAC;EAE5BrE,SAAS,CAAC,MAAM;IACdgF,GAAG,CAACC,OAAO,GAAGZ,KAAK;EACrB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,OAAOW,GAAG,CAACC,OAAO;AACpB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"api_provider.js","names":["focusManager","QueryClient","QueryClientProvider","usePrefetchQuery","React","useContext","useEffect","useRef","useApiClient","useAppState","appGrantsQueryOptions","featuresQueryOptions","useJoltForegroundPing","emitAuthRefresh","ResponseError","ChatContext","jsx","_jsx","jsxs","_jsxs","apiClient","defaultQueryFn","queryKey","Error","url","data","headers","app","get","configuredRetry","failureCount","error","is429Error","status","chatQueryClient","defaultOptions","queries","queryFn","retry","ApiProvider","t0","$","_c","children","token","env","session","t1","sessionChanged","useSessionChanged","client","t2","t3","isFetching","cancelQueries","then","_temp","clear","t4","t5","t6","isAuthenticated","PrefetchQueries","t7","Symbol","for","JoltForegroundPing","t8","invalidateQueries","useFocusManager","appState","setFocused","value","newToken","newEnv","prevToken","prevEnv","usePrevious","isInitialLogin","tokenChanged","Boolean","access_token","envChanged","ref","current"],"sources":["../../src/contexts/api_provider.tsx"],"sourcesContent":["import {\n focusManager,\n QueryClient,\n QueryClientProvider,\n QueryKey,\n usePrefetchQuery,\n} from '@tanstack/react-query'\nimport React, { useContext, useEffect, useRef } from 'react'\nimport { ViewProps } from 'react-native'\nimport { ApiClient, useApiClient } from '../hooks/use_api_client'\nimport { useAppState } from '../hooks/use_app_state'\nimport { appGrantsQueryOptions } from '../hooks/use_chat_permissions'\nimport { featuresQueryOptions } from '../hooks/use_features'\nimport { useJoltForegroundPing } from '../hooks/use_jolt'\nimport { RequestQueryKey } from '../hooks/use_suspense_api'\nimport { emitAuthRefresh } from '../utils/auth_events'\nimport { ResponseError } from '../utils/response_error'\nimport { ChatContext, ChatContextValue } from './chat_context'\n\nlet apiClient: ApiClient | undefined\n\nconst defaultQueryFn = ({ queryKey }: { queryKey: QueryKey }) => {\n if (!apiClient) {\n throw new Error('No token present')\n }\n\n const [url, data, headers, app = 'chat'] = queryKey as RequestQueryKey\n\n return apiClient[app].get({ url, data, headers })\n}\n\nconst configuredRetry = (failureCount: number, error: any) => {\n if (is429Error(error)) return false\n\n return failureCount < 3\n}\n\nconst is429Error = (error: any): boolean => {\n return error instanceof ResponseError && error.status === 429\n}\n\nexport const chatQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n queryFn: defaultQueryFn,\n retry: configuredRetry,\n },\n },\n})\n\nexport function ApiProvider({ children }: ViewProps) {\n const { token, env, session } = useContext(ChatContext)\n const sessionChanged = useSessionChanged({ token, env })\n\n const client = useApiClient()\n\n useEffect(() => {\n if (!sessionChanged) return\n\n emitAuthRefresh()\n\n if (chatQueryClient.isFetching()) {\n chatQueryClient.cancelQueries().then(() => chatQueryClient.invalidateQueries())\n return\n }\n\n chatQueryClient.clear()\n }, [sessionChanged])\n\n useEffect(() => {\n apiClient = client\n }, [client])\n\n return (\n <QueryClientProvider client={chatQueryClient}>\n {session.isAuthenticated && <PrefetchQueries />}\n <JoltForegroundPing />\n {children}\n </QueryClientProvider>\n )\n}\n\n// Component to prefetch queries when the app is focused\n// This needs to live in the provider so that it can access the api client\n// and the chat query client\nconst PrefetchQueries = () => {\n const client = useApiClient()\n\n usePrefetchQuery(appGrantsQueryOptions(client))\n usePrefetchQuery(featuresQueryOptions(client))\n\n return null\n}\n\nconst JoltForegroundPing = () => {\n useJoltForegroundPing()\n\n return null\n}\n\nexport function useFocusManager() {\n const appState = useAppState()\n\n useEffect(() => {\n focusManager.setFocused(appState === 'active')\n }, [appState])\n\n return appState\n}\n\nfunction useSessionChanged(value: Pick<ChatContextValue, 'token' | 'env'>): boolean {\n const { token: newToken, env: newEnv } = value\n const { token: prevToken, env: prevEnv } = usePrevious<typeof value>(value)\n\n const isInitialLogin = !prevToken && !!newToken\n if (isInitialLogin) return false\n\n const tokenChanged = Boolean(\n prevToken?.access_token && newToken?.access_token !== prevToken?.access_token\n )\n\n const envChanged = Boolean(prevEnv && newEnv !== prevEnv)\n\n return tokenChanged || envChanged\n}\n\nfunction usePrevious<T>(value: T): T {\n const ref = useRef<T>(value)\n\n useEffect(() => {\n ref.current = value\n }, [value])\n\n return ref.current\n}\n"],"mappings":";AAAA,SACEA,YAAY,EACZC,WAAW,EACXC,mBAAmB,EAEnBC,gBAAgB,QACX,uBAAuB;AAC9B,OAAOC,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAE5D,SAAoBC,YAAY,QAAQ,yBAAyB;AACjE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,qBAAqB,QAAQ,mBAAmB;AAEzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,WAAW,QAA0B,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9D,IAAIC,SAAgC;AAEpC,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAiC,CAAC,KAAK;EAC/D,IAAI,CAACF,SAAS,EAAE;IACd,MAAM,IAAIG,KAAK,CAAC,kBAAkB,CAAC;EACrC;EAEA,MAAM,CAACC,GAAG,EAAEC,IAAI,EAAEC,OAAO,EAAEC,GAAG,GAAG,MAAM,CAAC,GAAGL,QAA2B;EAEtE,OAAOF,SAAS,CAACO,GAAG,CAAC,CAACC,GAAG,CAAC;IAAEJ,GAAG;IAAEC,IAAI;IAAEC;EAAQ,CAAC,CAAC;AACnD,CAAC;AAED,MAAMG,eAAe,GAAGA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@ -29,6 +29,5 @@ export * from './use_reduce_motion';
|
|
|
29
29
|
export * from './use_scalable_number_of_lines';
|
|
30
30
|
export * from './use_submit_age_check';
|
|
31
31
|
export * from './use_suspense_api';
|
|
32
|
-
export * from './use_system_message_people';
|
|
33
32
|
export * from './use_theme';
|
|
34
33
|
//# sourceMappingURL=index.js.map
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useApiClient"],"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './use_animated_message_background_color'\nexport { useApiClient } from './use_api_client'\nexport * from './use_api'\nexport * from './use_app_state'\nexport * from './use_async_storage'\nexport * from './use_can_browse_archived_conversations'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_chat_permissions'\nexport * from './use_create_android_ripple_color'\nexport * from './use_current_person'\nexport * from './use_deleting_ids'\nexport * from './use_direct_message_eligibility'\nexport * from './use_direct_messages_eligible'\nexport * from './use_font_scale'\nexport * from './use_has_direct_messages'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_selected_chip_background_color'\nexport * from './use_interaction_tinted_background_color'\nexport * from './use_manual_archiving_enabled'\nexport * from './use_message_reaction_toggle'\nexport * from './use_new_conversation_entry'\nexport * from './use_organization'\nexport * from './use_people_person'\nexport * from './use_preview_avatar_diameter'\nexport * from './use_product_analytics'\nexport * from './use_qualified_by_age'\nexport * from './use_reduce_motion'\nexport * from './use_scalable_number_of_lines'\nexport * from './use_submit_age_check'\nexport * from './use_suspense_api'\nexport * from './
|
|
1
|
+
{"version":3,"file":"index.js","names":["useApiClient"],"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './use_animated_message_background_color'\nexport { useApiClient } from './use_api_client'\nexport * from './use_api'\nexport * from './use_app_state'\nexport * from './use_async_storage'\nexport * from './use_can_browse_archived_conversations'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_chat_permissions'\nexport * from './use_create_android_ripple_color'\nexport * from './use_current_person'\nexport * from './use_deleting_ids'\nexport * from './use_direct_message_eligibility'\nexport * from './use_direct_messages_eligible'\nexport * from './use_font_scale'\nexport * from './use_has_direct_messages'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_selected_chip_background_color'\nexport * from './use_interaction_tinted_background_color'\nexport * from './use_manual_archiving_enabled'\nexport * from './use_message_reaction_toggle'\nexport * from './use_new_conversation_entry'\nexport * from './use_organization'\nexport * from './use_people_person'\nexport * from './use_preview_avatar_diameter'\nexport * from './use_product_analytics'\nexport * from './use_qualified_by_age'\nexport * from './use_reduce_motion'\nexport * from './use_scalable_number_of_lines'\nexport * from './use_submit_age_check'\nexport * from './use_suspense_api'\nexport * from './use_theme'\n"],"mappings":"AAAA,cAAc,yCAAyC;AACvD,SAASA,YAAY,QAAQ,kBAAkB;AAC/C,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,yCAAyC;AACvD,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB;AACtC,cAAc,mCAAmC;AACjD,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,kCAAkC;AAChD,cAAc,gCAAgC;AAC9C,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;AACzC,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,sCAAsC;AACpD,cAAc,2CAA2C;AACzD,cAAc,gCAAgC;AAC9C,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,qBAAqB;AACnC,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,aAAa","ignoreList":[]}
|
|
@@ -1,46 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useMutation,
|
|
3
|
-
import { Alert
|
|
4
|
-
import { updateAllRecordsInPagesData } from '../utils/cache/page_mutations';
|
|
2
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { Alert } from 'react-native';
|
|
5
4
|
import { transformGetToPost } from '../utils/client/request_helpers';
|
|
6
5
|
import { useApiClient } from './use_api_client';
|
|
7
6
|
import { getConversationRequestArgs } from './use_conversation';
|
|
8
7
|
import { getRequestQueryKey } from './use_suspense_api';
|
|
9
8
|
import { useUploadClient } from './use_upload_client';
|
|
10
|
-
const MUTATION_KEY = 'updateConversationAvatar';
|
|
11
|
-
export const usePendingConversationAvatarUpdate = conversationId => {
|
|
12
|
-
const $ = _c(4);
|
|
13
|
-
let t0;
|
|
14
|
-
if ($[0] !== conversationId) {
|
|
15
|
-
t0 = {
|
|
16
|
-
filters: {
|
|
17
|
-
mutationKey: [MUTATION_KEY, conversationId],
|
|
18
|
-
exact: true
|
|
19
|
-
},
|
|
20
|
-
select: _temp
|
|
21
|
-
};
|
|
22
|
-
$[0] = conversationId;
|
|
23
|
-
$[1] = t0;
|
|
24
|
-
} else {
|
|
25
|
-
t0 = $[1];
|
|
26
|
-
}
|
|
27
|
-
const t1 = useMutationState(t0);
|
|
28
|
-
let t2;
|
|
29
|
-
if ($[2] !== t1) {
|
|
30
|
-
t2 = t1.at(-1);
|
|
31
|
-
$[2] = t1;
|
|
32
|
-
$[3] = t2;
|
|
33
|
-
} else {
|
|
34
|
-
t2 = $[3];
|
|
35
|
-
}
|
|
36
|
-
const newest = t2;
|
|
37
|
-
if (conversationId === undefined || newest?.status !== "pending") {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
return newest.variables;
|
|
41
|
-
};
|
|
42
9
|
export const useConversationAvatarUpdate = t0 => {
|
|
43
|
-
const $ = _c(
|
|
10
|
+
const $ = _c(21);
|
|
44
11
|
const {
|
|
45
12
|
conversationId
|
|
46
13
|
} = t0;
|
|
@@ -63,34 +30,18 @@ export const useConversationAvatarUpdate = t0 => {
|
|
|
63
30
|
}
|
|
64
31
|
const queryKey = t1;
|
|
65
32
|
let t2;
|
|
66
|
-
if ($[3] !== conversationId
|
|
67
|
-
t2 =
|
|
68
|
-
mutationKey: [MUTATION_KEY, conversationId],
|
|
69
|
-
exact: true
|
|
70
|
-
}).at(-1)?.state.variables !== payload;
|
|
33
|
+
if ($[3] !== conversationId) {
|
|
34
|
+
t2 = ["updateConversationAvatar", conversationId];
|
|
71
35
|
$[3] = conversationId;
|
|
72
|
-
$[4] =
|
|
73
|
-
$[5] = t2;
|
|
36
|
+
$[4] = t2;
|
|
74
37
|
} else {
|
|
75
|
-
t2 = $[
|
|
38
|
+
t2 = $[4];
|
|
76
39
|
}
|
|
77
|
-
const isSuperseded = t2;
|
|
78
40
|
let t3;
|
|
79
|
-
if ($[6] !== conversationId) {
|
|
80
|
-
t3 =
|
|
81
|
-
$[6] = conversationId;
|
|
82
|
-
$[7] = t3;
|
|
83
|
-
} else {
|
|
84
|
-
t3 = $[7];
|
|
85
|
-
}
|
|
86
|
-
let t4;
|
|
87
|
-
if ($[8] !== apiClient || $[9] !== conversationId || $[10] !== isSuperseded || $[11] !== requestArgs || $[12] !== uploadClient) {
|
|
88
|
-
t4 = async payload_0 => {
|
|
41
|
+
if ($[5] !== apiClient || $[6] !== conversationId || $[7] !== requestArgs || $[8] !== uploadClient) {
|
|
42
|
+
t3 = async payload => {
|
|
89
43
|
const postArgs = transformGetToPost(requestArgs).data;
|
|
90
|
-
const attributes = await buildAttributes(
|
|
91
|
-
if (isSuperseded(payload_0)) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
44
|
+
const attributes = await buildAttributes(payload, uploadClient);
|
|
94
45
|
return apiClient.chat.patch({
|
|
95
46
|
url: `/me/conversations/${conversationId}/`,
|
|
96
47
|
data: {
|
|
@@ -102,18 +53,19 @@ export const useConversationAvatarUpdate = t0 => {
|
|
|
102
53
|
}
|
|
103
54
|
});
|
|
104
55
|
};
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[13] = t4;
|
|
56
|
+
$[5] = apiClient;
|
|
57
|
+
$[6] = conversationId;
|
|
58
|
+
$[7] = requestArgs;
|
|
59
|
+
$[8] = uploadClient;
|
|
60
|
+
$[9] = t3;
|
|
111
61
|
} else {
|
|
112
|
-
|
|
62
|
+
t3 = $[9];
|
|
113
63
|
}
|
|
64
|
+
let t4;
|
|
114
65
|
let t5;
|
|
115
|
-
|
|
116
|
-
|
|
66
|
+
let t6;
|
|
67
|
+
if ($[10] !== queryClient || $[11] !== queryKey) {
|
|
68
|
+
t4 = async payload_0 => {
|
|
117
69
|
await queryClient.cancelQueries({
|
|
118
70
|
queryKey
|
|
119
71
|
});
|
|
@@ -124,89 +76,54 @@ export const useConversationAvatarUpdate = t0 => {
|
|
|
124
76
|
}
|
|
125
77
|
return {
|
|
126
78
|
...prev,
|
|
127
|
-
data:
|
|
79
|
+
data: buildOptimisticData(prev.data, payload_0)
|
|
128
80
|
};
|
|
129
81
|
});
|
|
130
82
|
return {
|
|
131
83
|
previous
|
|
132
84
|
};
|
|
133
85
|
};
|
|
134
|
-
|
|
135
|
-
$[15] = queryKey;
|
|
136
|
-
$[16] = t5;
|
|
137
|
-
} else {
|
|
138
|
-
t5 = $[16];
|
|
139
|
-
}
|
|
140
|
-
let t6;
|
|
141
|
-
if ($[17] !== conversationId || $[18] !== queryClient || $[19] !== queryKey) {
|
|
142
|
-
t6 = async (response, _payload, _context) => {
|
|
143
|
-
if (!response) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
86
|
+
t5 = (response, _payload, _context) => {
|
|
146
87
|
queryClient.setQueryData(queryKey, () => response);
|
|
147
|
-
queryClient.setQueriesData({
|
|
148
|
-
queryKey: ["/me/conversations"]
|
|
149
|
-
}, prev_0 => {
|
|
150
|
-
if (!prev_0?.pages) {
|
|
151
|
-
return prev_0;
|
|
152
|
-
}
|
|
153
|
-
return updateAllRecordsInPagesData({
|
|
154
|
-
data: prev_0,
|
|
155
|
-
processRecord: record => record.id === conversationId ? applySavedAvatar(record, response.data) : record
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
88
|
queryClient.invalidateQueries({
|
|
159
89
|
queryKey: ["/me/conversations"]
|
|
160
90
|
});
|
|
161
|
-
const imageUrl = response.data.customAvatarImageUrl;
|
|
162
|
-
if (imageUrl) {
|
|
163
|
-
await Image.prefetch(imageUrl).catch(_temp2);
|
|
164
|
-
}
|
|
165
91
|
};
|
|
166
|
-
|
|
167
|
-
$[18] = queryClient;
|
|
168
|
-
$[19] = queryKey;
|
|
169
|
-
$[20] = t6;
|
|
170
|
-
} else {
|
|
171
|
-
t6 = $[20];
|
|
172
|
-
}
|
|
173
|
-
let t7;
|
|
174
|
-
if ($[21] !== isSuperseded || $[22] !== queryClient || $[23] !== queryKey) {
|
|
175
|
-
t7 = (_error, payload_2, context) => {
|
|
176
|
-
if (isSuperseded(payload_2)) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
92
|
+
t6 = (_error, _payload_0, context) => {
|
|
179
93
|
if (context?.previous) {
|
|
180
94
|
queryClient.setQueryData(queryKey, context.previous);
|
|
181
95
|
}
|
|
182
96
|
Alert.alert("Error", "Failed to update conversation avatar. Please try again.");
|
|
183
97
|
};
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
98
|
+
$[10] = queryClient;
|
|
99
|
+
$[11] = queryKey;
|
|
100
|
+
$[12] = t4;
|
|
101
|
+
$[13] = t5;
|
|
102
|
+
$[14] = t6;
|
|
188
103
|
} else {
|
|
189
|
-
|
|
104
|
+
t4 = $[12];
|
|
105
|
+
t5 = $[13];
|
|
106
|
+
t6 = $[14];
|
|
190
107
|
}
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
193
|
-
|
|
194
|
-
mutationKey:
|
|
195
|
-
mutationFn:
|
|
196
|
-
onMutate:
|
|
197
|
-
onSuccess:
|
|
198
|
-
onError:
|
|
108
|
+
let t7;
|
|
109
|
+
if ($[15] !== t2 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
|
|
110
|
+
t7 = {
|
|
111
|
+
mutationKey: t2,
|
|
112
|
+
mutationFn: t3,
|
|
113
|
+
onMutate: t4,
|
|
114
|
+
onSuccess: t5,
|
|
115
|
+
onError: t6
|
|
199
116
|
};
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
117
|
+
$[15] = t2;
|
|
118
|
+
$[16] = t3;
|
|
119
|
+
$[17] = t4;
|
|
120
|
+
$[18] = t5;
|
|
121
|
+
$[19] = t6;
|
|
122
|
+
$[20] = t7;
|
|
206
123
|
} else {
|
|
207
|
-
|
|
124
|
+
t7 = $[20];
|
|
208
125
|
}
|
|
209
|
-
return useMutation(
|
|
126
|
+
return useMutation(t7);
|
|
210
127
|
};
|
|
211
128
|
export async function patchConversationAvatar(apiClient, uploadClient, conversationId, payload) {
|
|
212
129
|
const requestArgs = getConversationRequestArgs({
|
|
@@ -229,16 +146,7 @@ export async function patchConversationAvatar(apiClient, uploadClient, conversat
|
|
|
229
146
|
Alert.alert('Avatar not saved', 'The conversation was created, but the avatar could not be saved. You can update it from the conversation details.');
|
|
230
147
|
}
|
|
231
148
|
}
|
|
232
|
-
function
|
|
233
|
-
return {
|
|
234
|
-
...data,
|
|
235
|
-
customAvatarType: saved.customAvatarType,
|
|
236
|
-
customAvatarKey: saved.customAvatarKey,
|
|
237
|
-
customAvatarColor: saved.customAvatarColor,
|
|
238
|
-
customAvatarImageUrl: saved.customAvatarImageUrl
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
export function applyAvatarUpdate(data, payload) {
|
|
149
|
+
function buildOptimisticData(data, payload) {
|
|
242
150
|
switch (payload.kind) {
|
|
243
151
|
case 'icon':
|
|
244
152
|
return {
|
|
@@ -309,10 +217,4 @@ async function buildAttributes(payload, uploadClient) {
|
|
|
309
217
|
};
|
|
310
218
|
}
|
|
311
219
|
}
|
|
312
|
-
function _temp(mutation) {
|
|
313
|
-
return mutation.state;
|
|
314
|
-
}
|
|
315
|
-
function _temp2() {
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
220
|
//# sourceMappingURL=use_conversation_avatar_update.js.map
|