Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Fix drawer dismiss crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan committed Aug 10, 2023
1 parent bee8bd1 commit c927e9c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const BlockMessagesDrawer = () => {
const neutral = useColor('neutral')
const dispatch = useDispatch()
const { data } = useDrawer('BlockMessages')
const { userId, shouldOpenChat, isReportAbuse } = data
const { userId, shouldOpenChat, isReportAbuse } = data ?? {}
const user = useSelector((state) => getUser(state, { id: userId }))
// Assuming blockees have already been fetched in ProfileActionsDrawer.
const doesBlockUser = useSelector((state) => getDoesBlockUser(state, userId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const ChatActionsDrawer = () => {
const dispatch = useDispatch()
const navigation = useNavigation()
const { data } = useDrawer('ChatActions')
const { userId, chatId } = data
const { userId, chatId } = data ?? {}
const doesBlockUser = useSelector((state: AppState) =>
getDoesBlockUser(state, userId)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const CreateChatActionsDrawer = () => {
const dispatch = useDispatch()
const navigation = useNavigation()
const { data } = useDrawer('CreateChatActions')
const { userId } = data
const { userId } = data ?? {}
const doesBlockUser = useSelector((state: AppState) =>
getDoesBlockUser(state, userId)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const DeleteChatDrawer = () => {
const neutralLight2 = useColor('neutralLight2')
const dispatch = useDispatch()
const { data } = useDrawer('DeleteChat')
const { chatId } = data
const { chatId } = data ?? {}

const closeDrawer = useCallback(() => {
dispatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const drawerName = 'RemoveDownloadedCollection'

export const RemoveDownloadedCollectionDrawer = () => {
const { data } = useDrawer(drawerName)
const { collectionId } = data
const { collectionId } = data ?? {}
const dispatch = useDispatch()

const isAlbum = useSelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { unsaveCollection } = collectionsSocialActions
export const UnfavoriteDownloadedCollectionDrawer = () => {
const { data } = useDrawer(drawerName)
const dispatch = useDispatch()
const { collectionId } = data
const { collectionId } = data ?? {}

const isAlbum = useSelector(
(state: CommonState) =>
Expand Down

0 comments on commit c927e9c

Please sign in to comment.