Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: do not check for subscriptions in github release

ammarahm-ede37b57b64bcd
diff --git a/apps/mobile/app/components/launcher/index.js b/apps/mobile/app/components/launcher/index.js
index 5708e5a2e..9db395c8e 100644
--- a/apps/mobile/app/components/launcher/index.js
+++ b/apps/mobile/app/components/launcher/index.js
@@ -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() {
diff --git a/apps/mobile/app/hooks/use-app-events.js b/apps/mobile/app/hooks/use-app-events.js
index 879077815..6dd4dd88c 100644
--- a/apps/mobile/app/hooks/use-app-events.js
+++ b/apps/mobile/app/hooks/use-app-events.js
@@ -213,7 +213,6 @@ export const useAppEvents = () => {
}, []);
const onSyncComplete = useCallback(async () => {
- console.log('Sync complete');
initAfterSync();
setLastSynced(await db.lastSynced());
eSendEvent(eCloseProgressDialog, "sync_progress");
diff --git a/apps/mobile/app/screens/settings/subscription.js b/apps/mobile/app/screens/settings/subscription.js
index 3243ff974..30ecd25ee 100644
--- a/apps/mobile/app/screens/settings/subscription.js
+++ b/apps/mobile/app/screens/settings/subscription.js
@@ -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");
diff --git a/apps/mobile/app/services/event-manager.ts b/apps/mobile/app/services/event-manager.ts
index 63ae30d7c..6090aaa57 100644
--- a/apps/mobile/app/services/event-manager.ts
+++ b/apps/mobile/app/services/event-manager.ts
@@ -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,
diff --git a/apps/mobile/app/services/premium.js b/apps/mobile/app/services/premium.js
index bdedcb685..b0ed74bee 100644
--- a/apps/mobile/app/services/premium.js
+++ b/apps/mobile/app/services/premium.js
@@ -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);
}
}