Adds ErrorBoundary around stories

This commit is contained in:
Josh Perez 2022-07-28 20:10:07 -04:00 committed by GitHub
parent 37f9346f57
commit d7ec2e9d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 3 deletions

View file

@ -33,13 +33,16 @@ import { getConversationsStoppingSend } from '../selectors/conversations';
import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions';
import { mapDispatchToProps } from '../actions';
import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog';
import { ErrorBoundary } from '../../components/ErrorBoundary';
const mapStateToProps = (state: StateType) => {
const i18n = getIntl(state);
return {
...state.app,
conversationsStoppingSend: getConversationsStoppingSend(state),
getPreferredBadge: getPreferredBadgeSelector(state),
i18n: getIntl(state),
i18n,
localeMessages: getLocaleMessages(state),
isCustomizingPreferredReactions: getIsCustomizingPreferredReactions(state),
isMaximized: getIsMainWindowMaximized(state),
@ -57,9 +60,17 @@ const mapStateToProps = (state: StateType) => {
<SmartSafetyNumberViewer {...props} />
),
isShowingStoriesView: shouldShowStoriesView(state),
renderStories: () => <SmartStories />,
renderStories: () => (
<ErrorBoundary>
<SmartStories />
</ErrorBoundary>
),
selectedStoryData: getSelectedStoryData(state),
renderStoryViewer: () => <SmartStoryViewer />,
renderStoryViewer: () => (
<ErrorBoundary>
<SmartStoryViewer />
</ErrorBoundary>
),
requestVerification: (
type: 'sms' | 'voice',
number: string,