Skip to content

Commit

Permalink
fix init issue because of details being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalkishor1991 committed Jul 5, 2024
1 parent 287fb59 commit 5d0c9ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions hooks/useApplicationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const useApplicationStore = create((set) => ({
pro: {
plan: "free"
},
purchaseDetails: null,
detailedColor: null,
commonPalettes: [],

Expand Down Expand Up @@ -97,7 +96,7 @@ const useApplicationStore = create((set) => ({
},

setPurchase: (plan) => {
set({ pro: {plan: plan}, purchaseDetails: details });
set({ pro: {plan: plan} });
},

setDetailedColor: (detailedColor) => {
Expand Down
2 changes: 1 addition & 1 deletion libs/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const purchase = async function (setPurchase, productSKU) {
}
try {
await getProducts({ skus: [productSKU] });
const details = await requestPurchase({
await requestPurchase({
skus: [productSKU]
});
await setPurchase(skuToPlanMapping[productSKU]);
Expand Down
5 changes: 4 additions & 1 deletion screens/ProVersionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function ProScreen() {
</View>

{isFree && (
<View>
<View style={styles.restoreProView}>
<Text style={styles.title}>{t('Restore Purchase')}</Text>
<CromaButton
style={styles.restoreButton}
Expand Down Expand Up @@ -183,5 +183,8 @@ const styles = StyleSheet.create({
paddingVertical: 12,
marginBottom: 16,
backgroundColor: Colors.secondary
},
restoreProView: {
marginBottom: 24
}
});

0 comments on commit 5d0c9ae

Please sign in to comment.