diff --git a/android/app/build.gradle b/android/app/build.gradle index 1196924d..20c97b1d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -120,8 +120,8 @@ android { applicationId "com.betterrail" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 82 - versionName "2.3.0" + versionCode 83 + versionName "2.3.1" missingDimensionStrategy "store", "play" } diff --git a/app/screens/announcements/use-service-updates.ts b/app/screens/announcements/use-service-updates.ts index b4026fc6..90921eee 100644 --- a/app/screens/announcements/use-service-updates.ts +++ b/app/screens/announcements/use-service-updates.ts @@ -3,6 +3,7 @@ import firestore from "@react-native-firebase/firestore" import { toJS } from "mobx" import { useStores } from "../../models" import { userLocale } from "../../i18n" +import { uniq } from "lodash" export interface ServiceUpdate { expireAt: Date @@ -12,15 +13,19 @@ export interface ServiceUpdate { } export function useServiceUpdates() { - const { settings } = useStores() + const { settings, favoriteRoutes } = useStores() return useQuery("serviceUpdates", async () => { let data: ServiceUpdate[] = [] + // Get all the station that the user has notifications enabled for, including their favorite routes + const favoriteStations = favoriteRoutes.routes.flatMap((route) => [route.originId, route.destinationId]) + const notificationsStations = uniq([...toJS(settings.stationsNotifications), ...favoriteStations]) + const querySnapshot = await firestore() .collection("service-updates") .where("expiresAt", ">", new Date()) - .where("stations", "array-contains-any", [...toJS(settings.stationsNotifications), "all-stations"]) + .where("stations", "array-contains-any", [...notificationsStations, "all-stations"]) .get() querySnapshot.forEach((doc) => { diff --git a/ios/BetterRail.xcodeproj/project.pbxproj b/ios/BetterRail.xcodeproj/project.pbxproj index fa03285a..2306a1f3 100644 --- a/ios/BetterRail.xcodeproj/project.pbxproj +++ b/ios/BetterRail.xcodeproj/project.pbxproj @@ -1251,7 +1251,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BetterRail/BetterRailDebug.entitlements; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; ENABLE_BITCODE = NO; @@ -1261,7 +1261,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.3.0; + MARKETING_VERSION = 2.3.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1294,7 +1294,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; INFOPLIST_FILE = BetterRail/Info.plist; @@ -1303,7 +1303,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.3.0; + MARKETING_VERSION = 2.3.1; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/ios/BetterRail/Info.plist b/ios/BetterRail/Info.plist index db42730e..3f94e0cf 100644 --- a/ios/BetterRail/Info.plist +++ b/ios/BetterRail/Info.plist @@ -23,7 +23,7 @@ CFBundleSignature ???? CFBundleVersion - 17 + 1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/BetterRailWidget/Info.plist b/ios/BetterRailWidget/Info.plist index 9111f9da..5a02ab35 100644 --- a/ios/BetterRailWidget/Info.plist +++ b/ios/BetterRailWidget/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 17 + 1 LSApplicationCategoryType NSExtension diff --git a/ios/BetterRailWidget/WatchInfo.plist b/ios/BetterRailWidget/WatchInfo.plist index e9d7835c..e6b258eb 100644 --- a/ios/BetterRailWidget/WatchInfo.plist +++ b/ios/BetterRailWidget/WatchInfo.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 17 + 1 NSExtension NSExtensionPointIdentifier diff --git a/ios/StationIntent/Info.plist b/ios/StationIntent/Info.plist index 4d6ae122..9556813f 100644 --- a/ios/StationIntent/Info.plist +++ b/ios/StationIntent/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 17 + 1 NSExtension NSExtensionAttributes