Skip to content

Commit

Permalink
feat: navigate back to inbox if user does not accept
Browse files Browse the repository at this point in the history
  • Loading branch information
thoreyjona committed Sep 30, 2024
1 parent c48ef68 commit 9cfe090
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions apps/native/app/src/screens/document-detail/document-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
View,
} from 'react-native'
import {
Navigation,
NavigationFunctionComponent,
OptionsTopBarButton,
} from 'react-native-navigation'
Expand Down Expand Up @@ -267,7 +268,7 @@ export const DocumentDetailScreen: NavigationFunctionComponent<{
}),
style: 'cancel',
onPress: () => {
setLoaded(true)
Navigation.pop(componentId)
},
},
{
Expand All @@ -276,16 +277,16 @@ export const DocumentDetailScreen: NavigationFunctionComponent<{
}),
onPress: async () => {
setRefetching(true)
docRes
.refetch({
try {
const result = await docRes.refetch({
input: { id: docId, includeDocument: true },
})
.then(() => {
if (data.documentV2?.alert) {
setShowConfirmedAlert(true)
}
})
.finally(() => setRefetching(false))
if (result.data?.documentV2?.alert) {
setShowConfirmedAlert(true)
}
} finally {
setRefetching(false)
}
},
},
])
Expand Down

0 comments on commit 9cfe090

Please sign in to comment.