Skip to content

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

mobile: fix app freeze on adding > 3 notebooks

ammarahm-ed05f3709a5c5b
diff --git a/apps/mobile/app/components/premium/component.js b/apps/mobile/app/components/premium/component.js
index 34b77373e..b6de5d399 100644
--- a/apps/mobile/app/components/premium/component.js
+++ b/apps/mobile/app/components/premium/component.js
@@ -48,6 +48,7 @@ import { Walkthrough } from "../walkthroughs";
import { features } from "./features";
import { Group } from "./group";
import { PricingPlans } from "./pricing-plans";
+import { Platform } from 'react-native';
export const Component = ({ close, promo }) => {
const colors = useThemeStore((state) => state.colors);
@@ -104,7 +105,7 @@ export const Component = ({ close, promo }) => {
customStyle={{
position: "absolute",
right: DDS.isTab ? 30 : 15,
- top: 30,
+ top: Platform.OS === "ios" ? 0 : 30,
zIndex: 10,
width: 50,
height: 50
diff --git a/apps/mobile/app/services/premium.js b/apps/mobile/app/services/premium.js
index fc9b56120..bc30575ad 100644
--- a/apps/mobile/app/services/premium.js
+++ b/apps/mobile/app/services/premium.js
@@ -38,6 +38,7 @@ 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;
@@ -94,7 +95,7 @@ async function getProducts() {
}
function get() {
- if (__DEV__ || Config.isTesting) return true;
+ //if (__DEV__ || Config.isTesting) return true;
return SUBSCRIPTION_STATUS.BASIC !== premiumStatus;
}
@@ -150,7 +151,9 @@ const onUserStatusCheck = async (type) => {
};
break;
case CHECK_IDS.notebookAdd:
- eSendEvent(eOpenPremiumDialog);
+ setTimeout(() => {
+ eSendEvent(eOpenPremiumDialog);
+ }, 500);
break;
case CHECK_IDS.vaultAdd:
message = {