Skip to content

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

mobile: enable feature for pro users

Ammar Ahmed873b180dabbd
diff --git a/apps/mobile/app/hooks/use-actions.tsx b/apps/mobile/app/hooks/use-actions.tsx
index d74b89569..090f96088 100644
--- a/apps/mobile/app/hooks/use-actions.tsx
+++ b/apps/mobile/app/hooks/use-actions.tsx
@@ -162,7 +162,8 @@ export const useActions = ({
"shortcuts",
"notebooks",
"customizableSidebar",
- "customHomepage"
+ "customHomepage",
+ "androidLauncherShortcuts"
]);
const [item, setItem] = useState(propItem);
const { colors } = useThemeColors();
@@ -1201,7 +1202,21 @@ export const useActions = ({
id: "launcher-shortcut",
title: strings.addToHome(),
icon: "cellphone-arrow-down",
+ locked: !features?.androidLauncherShortcuts.isAllowed,
onPress: async () => {
+ if (features && !features?.androidLauncherShortcuts.isAllowed) {
+ ToastManager.show({
+ message: features?.androidLauncherShortcuts.error,
+ type: "info",
+ actionText: strings.upgrade(),
+ context: "local",
+ func: () => {
+ PaywallSheet.present(features?.androidLauncherShortcuts);
+ }
+ });
+ return;
+ }
+
try {
await NotesnookModule.addShortcut(
item.id,
diff --git a/packages/common/src/utils/is-feature-available.ts b/packages/common/src/utils/is-feature-available.ts
index 27e0cd6f0..b30df8136 100644
--- a/packages/common/src/utils/is-feature-available.ts
+++ b/packages/common/src/utils/is-feature-available.ts
@@ -469,6 +469,17 @@ const features = {
believer: createLimit(true),
legacyPro: createLimit(true)
}
+ }),
+ androidLauncherShortcuts: createFeature({
+ id: "androidLauncherShortcuts",
+ title: "Android Launcher Shortcuts",
+ availability: {
+ free: createLimit(false),
+ essential: createLimit(false),
+ pro: createLimit(true),
+ believer: createLimit(true),
+ legacyPro: createLimit(true)
+ }
})
};