Skip to content

Commit aec7373

Browse files
authored
🐛 - Include updates from favorite stations in announcements screen (#366)
1 parent 73066e0 commit aec7373

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ android {
120120
applicationId "com.betterrail"
121121
minSdkVersion rootProject.ext.minSdkVersion
122122
targetSdkVersion rootProject.ext.targetSdkVersion
123-
versionCode 82
124-
versionName "2.3.0"
123+
versionCode 83
124+
versionName "2.3.1"
125125
missingDimensionStrategy "store", "play"
126126
}
127127

app/screens/announcements/use-service-updates.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import firestore from "@react-native-firebase/firestore"
33
import { toJS } from "mobx"
44
import { useStores } from "../../models"
55
import { userLocale } from "../../i18n"
6+
import { uniq } from "lodash"
67

78
export interface ServiceUpdate {
89
expireAt: Date
@@ -12,15 +13,19 @@ export interface ServiceUpdate {
1213
}
1314

1415
export function useServiceUpdates() {
15-
const { settings } = useStores()
16+
const { settings, favoriteRoutes } = useStores()
1617

1718
return useQuery("serviceUpdates", async () => {
1819
let data: ServiceUpdate[] = []
1920

21+
// Get all the station that the user has notifications enabled for, including their favorite routes
22+
const favoriteStations = favoriteRoutes.routes.flatMap((route) => [route.originId, route.destinationId])
23+
const notificationsStations = uniq([...toJS(settings.stationsNotifications), ...favoriteStations])
24+
2025
const querySnapshot = await firestore()
2126
.collection("service-updates")
2227
.where("expiresAt", ">", new Date())
23-
.where("stations", "array-contains-any", [...toJS(settings.stationsNotifications), "all-stations"])
28+
.where("stations", "array-contains-any", [...notificationsStations, "all-stations"])
2429
.get()
2530

2631
querySnapshot.forEach((doc) => {

ios/BetterRail.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@
12511251
CLANG_ENABLE_MODULES = YES;
12521252
CODE_SIGN_ENTITLEMENTS = BetterRail/BetterRailDebug.entitlements;
12531253
CODE_SIGN_STYLE = Manual;
1254-
CURRENT_PROJECT_VERSION = 7;
1254+
CURRENT_PROJECT_VERSION = 1;
12551255
DEVELOPMENT_TEAM = "";
12561256
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
12571257
ENABLE_BITCODE = NO;
@@ -1261,7 +1261,7 @@
12611261
"$(inherited)",
12621262
"@executable_path/Frameworks",
12631263
);
1264-
MARKETING_VERSION = 2.3.0;
1264+
MARKETING_VERSION = 2.3.1;
12651265
OTHER_LDFLAGS = (
12661266
"$(inherited)",
12671267
"-ObjC",
@@ -1294,7 +1294,7 @@
12941294
CODE_SIGN_IDENTITY = "Apple Development";
12951295
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
12961296
CODE_SIGN_STYLE = Manual;
1297-
CURRENT_PROJECT_VERSION = 7;
1297+
CURRENT_PROJECT_VERSION = 1;
12981298
DEVELOPMENT_TEAM = "";
12991299
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX;
13001300
INFOPLIST_FILE = BetterRail/Info.plist;
@@ -1303,7 +1303,7 @@
13031303
"$(inherited)",
13041304
"@executable_path/Frameworks",
13051305
);
1306-
MARKETING_VERSION = 2.3.0;
1306+
MARKETING_VERSION = 2.3.1;
13071307
OTHER_LDFLAGS = (
13081308
"$(inherited)",
13091309
"-ObjC",

ios/BetterRail/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<key>CFBundleSignature</key>
2424
<string>????</string>
2525
<key>CFBundleVersion</key>
26-
<string>17</string>
26+
<string>1</string>
2727
<key>ITSAppUsesNonExemptEncryption</key>
2828
<false/>
2929
<key>LSApplicationQueriesSchemes</key>

ios/BetterRailWidget/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>17</string>
22+
<string>1</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string></string>
2525
<key>NSExtension</key>

ios/BetterRailWidget/WatchInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>17</string>
22+
<string>1</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionPointIdentifier</key>

ios/StationIntent/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>17</string>
22+
<string>1</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

0 commit comments

Comments
 (0)