Skip to content

Commit

Permalink
fix donation button (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Payalpie authored Sep 25, 2024
1 parent 2f0cceb commit adf298a
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/helpers/NavigationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class NavigationHelper {
navigate('ServiceScreen', {})
}
}
if(item.linkType === 'groups'){
if (item.linkType === 'groups') {
if (!UserHelper.currentUserChurch?.person?.id) Alert.alert("Alert", "You must be logged in to access this page.")
UserHelper.addOpenScreenEvent('MyGroups');
navigate('MyGroups')
Expand All @@ -70,14 +70,24 @@ export class NavigationHelper {

static navDonations(navigate: any) {
UserHelper.addOpenScreenEvent('DonationScreen');
// if (Platform.OS === "ios") {
// let url = "https://" + CacheHelper.church!.subDomain + ".b1.church/login/?returnUrl=%2Fdonation-landing";
// if (UserHelper.currentUserChurch.jwt) url += "&jwt=" + UserHelper.currentUserChurch.jwt;
// Linking.openURL(url);
// /*SafariView.isAvailable().then(() => {
// SafariView.show({ url: url })
// })*/
// } else navigate('DonationScreen')
if (Platform.OS === "ios") {
let url = "https://" + CacheHelper.church!.subDomain + ".b1.church/login/?returnUrl=%2Fdonation-landing";
if (UserHelper.currentUserChurch.jwt) url += "&jwt=" + UserHelper.currentUserChurch.jwt;
const jwt = UserHelper.currentUserChurch?.jwt;
if (jwt) {
url += "&jwt=" + jwt;
}
Linking.openURL(url);
/*SafariView.isAvailable().then(() => {
SafariView.show({ url: url })
})*/
} else navigate('DonationScreen')
} else {
navigate('DonationScreen');
}
}

}

0 comments on commit adf298a

Please sign in to comment.