Skip to content

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

check for app version in announcement

ammarahm-eda1970e67508c
diff --git a/apps/mobile/src/provider/stores.ts b/apps/mobile/src/provider/stores.ts
index a8c4ec291..958a4c824 100644
--- a/apps/mobile/src/provider/stores.ts
+++ b/apps/mobile/src/provider/stores.ts
@@ -2,7 +2,7 @@ import {Platform} from 'react-native';
import {Dimensions} from 'react-native';
import create from 'zustand';
import PremiumService from '../services/PremiumService';
-import {history, SUBSCRIPTION_STATUS} from '../utils';
+import {APP_VERSION, history, SUBSCRIPTION_STATUS} from '../utils';
import {db} from '../utils/database';
import {MMKV} from '../utils/mmkv';
import {
@@ -417,6 +417,11 @@ async function shouldShowAnnouncement(announcement) {
let show = announcement.platforms.some(
platform => allowedPlatforms.indexOf(platform) > -1
);
+
+ if (announcement.version) {
+ return announcement.version === APP_VERSION;
+ }
+
if (!show) return false;
const subStatus = PremiumService.getUser()?.subscription?.type;
show = announcement.userTypes.some(userType => {