fix: JSON.stringify cyclic error in showBuyDialog

This commit is contained in:
thecodrr
2021-06-17 08:58:02 +05:00
parent e7a28614e5
commit 43dc570cdc
7 changed files with 8 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ function AppEffects({ isMobile, isTablet, setShow }) {
} else {
if (type !== CHECK_IDS.databaseSync)
await import("./common/dialogcontroller").then((dialogs) =>
dialogs.showBuyDialog(type)
dialogs.showBuyDialog()
);
return { type, result: false };
}

View File

@@ -62,6 +62,7 @@ async function openPaddleDialog(overrideUrl) {
}
async function getCouponData(coupon) {
console.log(coupon);
let url =
"https://checkout-service.paddle.com/checkout/97379638-chre9f4b00ed6b3-732b0e853d/coupon";
const response = await fetch(url, {

View File

@@ -17,7 +17,7 @@ function AccentItem(props) {
onClick={async () => {
if (isUserPremium()) setAccent(code);
else {
await showBuyDialog("customize");
await showBuyDialog();
}
}}
key={label}

View File

@@ -131,6 +131,7 @@ function BuyDialog(props) {
withoutDiscount: data.total[0],
});
} catch (e) {
console.error(e);
setError(e.message);
} finally {
setIsLoading(false);

View File

@@ -219,7 +219,7 @@ function TinyMCE(props) {
!isUserPremium()
) {
command.preventDefault();
await showBuyDialog("editor");
await showBuyDialog();
return;
}
}}

View File

@@ -16,7 +16,7 @@ function Toggle(props) {
onClick={async () => {
if (isUserPremium() || !premium) onToggled();
else {
await showBuyDialog(premium);
await showBuyDialog();
}
}}
py={2}

View File

@@ -504,7 +504,7 @@ function OptionsItem(props) {
if (isUserPremium() || !premium)
onSelectionChanged(option, index);
else {
await showBuyDialog(premium);
await showBuyDialog();
}
}}
sx={{
@@ -617,7 +617,7 @@ function AccountStatus(props) {
</Text>
{subtitle && <Text variant="subBody">{subtitle}</Text>}
{isBasic || isTrial || remainingDays <= 0 ? (
<Button mt={2} onClick={showBuyDialog}>
<Button mt={2} onClick={() => showBuyDialog()}>
Upgrade to Notesnook Pro
</Button>
) : provider === "Streetwriters" ? (