mobile: do not check for subscriptions in

github release
This commit is contained in:
ammarahm-ed
2022-10-26 10:34:18 +05:00
parent a85518d497
commit e37b57b64b
5 changed files with 15 additions and 16 deletions

View File

@@ -55,7 +55,7 @@ import { SvgView } from "../ui/svg";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { Walkthrough } from "../walkthroughs";
import { Config } from "react-native-config";
import Config from "react-native-config";
const Launcher = React.memo(
function Launcher() {

View File

@@ -213,7 +213,6 @@ export const useAppEvents = () => {
}, []);
const onSyncComplete = useCallback(async () => {
console.log('Sync complete');
initAfterSync();
setLastSynced(await db.lastSynced());
eSendEvent(eCloseProgressDialog, "sync_progress");

View File

@@ -34,7 +34,7 @@ import {
} from "../../utils/constants";
import { eOpenPremiumDialog } from "../../utils/events";
import { SIZE } from "../../utils/size";
import { Config } from "react-native-config";
import Config from "react-native-config";
export const Subscription = () => {
const user = useUserStore((state) => state.user);
const monthlyPlan = usePricing("monthly");

View File

@@ -21,7 +21,7 @@ import Clipboard from "@react-native-clipboard/clipboard";
import EventManager from "@notesnook/core/utils/event-manager";
import { RefObject } from "react";
import ActionSheet from "react-native-actions-sheet";
import { Config } from "react-native-config";
import Config from "react-native-config";
import {
eHideToast,
eOnNoteEdited,

View File

@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { CHECK_IDS } from "@notesnook/core/common";
import React from "react";
import { Platform } from "react-native";
import Config from "react-native-config";
import * as RNIap from "react-native-iap";
import { db } from "../common/database";
import { MMKV } from "../common/database/mmkv";
@@ -35,10 +36,8 @@ import {
eShowGetPremium
} from "../utils/events";
import { eSendEvent, presentSheet, ToastEvent } from "./event-manager";
import Config from "react-native-config";
import SettingsService from "./settings";
import { sleep } from "../utils/time";
let premiumStatus = 0;
let products = [];
let user = null;
@@ -61,16 +60,17 @@ async function setPremiumStatus() {
}
} catch (e) {
premiumStatus = 0;
} finally {
if (get()) {
await subscriptions.clear();
}
try {
await RNIap.initConnection();
products = await RNIap.getSubscriptions(itemSkus);
} catch (e) {
console.log("subscriptions: ", e);
}
}
if (Config.GITHUB_RELEASE) return;
if (get()) {
await subscriptions.clear();
}
try {
await RNIap.initConnection();
products = await RNIap.getSubscriptions(itemSkus);
} catch (e) {
console.log("subscriptions: ", e);
}
}