Skip to content

Commit

Permalink
chore: remove lib checking the latest app version on the stores (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyirvo authored Nov 11, 2024
1 parent 544eda6 commit 4ff284b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 194 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
"react-native-svg": "15.2.0",
"react-native-toast-message": "2.2.1",
"semver": "7.6.3",
"sp-react-native-in-app-updates": "1.4.0",
"zod": "3.23.8",
"zustand": "4.5.2"
},
Expand Down
9 changes: 2 additions & 7 deletions src/features/home/components/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

import { config } from '$core/constants';
import { StoreUpdateBanner } from '$shared/components/StoreUpdateBanner';
import { Box, Text } from '$shared/uiKit/primitives';

export const Version = () => {
Expand All @@ -26,16 +25,12 @@ export const Version = () => {
marginBottom: insets.bottom,
}}
>
<Box px="spacing_24">
<StoreUpdateBanner />
</Box>

<Box alignItems="flex-end" pt="spacing_32" px="spacing_24">
{/* <Text variant="small">
<Text variant="small">
{`Version: v${config.version}${
config.buildNumber ? `:${config.buildNumber}` : ''
}`}
</Text> */}
</Text>

{typeof config.runtimeVersion === 'string' && (
<Text variant="small">{`Runtime: v${config.runtimeVersion}`}</Text>
Expand Down
61 changes: 0 additions & 61 deletions src/shared/components/StoreUpdateBanner.tsx

This file was deleted.

39 changes: 0 additions & 39 deletions src/shared/utils/checkForAppUpdates.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import * as Application from 'expo-application';
import * as Updates from 'expo-updates';
import type { StartUpdateOptions } from 'sp-react-native-in-app-updates';
import SpInAppUpdates, { IAUUpdateKind } from 'sp-react-native-in-app-updates';

import { config, IS_ANDROID } from '$core/constants';
import { Logger } from '$core/logger';

import { sleep } from './sleep';
Expand All @@ -27,38 +23,3 @@ export const checkForOtaUpdate = async () => {
});
}
};

export const checkForNativeUpdate = async (
updateOptionsOverwrites: StartUpdateOptions,
) => {
const inAppUpdates = new SpInAppUpdates(config.isDebug);

const currentVersion = Application.nativeApplicationVersion;
let updateOptions: StartUpdateOptions = {};
const { shouldUpdate, storeVersion } = await inAppUpdates.checkNeedsUpdate();

if (shouldUpdate) {
if (IS_ANDROID) {
updateOptions = {
...updateOptionsOverwrites,
updateType: IAUUpdateKind.FLEXIBLE,
};
} else {
updateOptions = updateOptionsOverwrites;
}

return {
shouldUpdate,
startUpdate: async () => inAppUpdates.startUpdate(updateOptions),
storeVersion,
currentVersion,
};
}

return {
shouldUpdate: false,
startUpdate: async () => {},
storeVersion,
currentVersion,
};
};
86 changes: 0 additions & 86 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7680,15 +7680,6 @@ __metadata:
languageName: node
linkType: hard

"apisauce@npm:^2.1.1":
version: 2.1.6
resolution: "apisauce@npm:2.1.6"
dependencies:
axios: "npm:^0.21.4"
checksum: 10c0/b4fbc478da3eb57d611346a70a7f35c0b9aff1e24472e1c069db38a32921a4022c7257310f84a41f580a1708013e3acd8d9c9f6b5319182ef0096d9a421481e2
languageName: node
linkType: hard

"app-icon-badge@npm:0.0.15":
version: 0.0.15
resolution: "app-icon-badge@npm:0.0.15"
Expand Down Expand Up @@ -7987,15 +7978,6 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.21.4":
version: 0.21.4
resolution: "axios@npm:0.21.4"
dependencies:
follow-redirects: "npm:^1.14.0"
checksum: 10c0/fbcff55ec68f71f02d3773d467db2fcecdf04e749826c82c2427a232f9eba63242150a05f15af9ef15818352b814257541155de0281f8fb2b7e8a5b79f7f2142
languageName: node
linkType: hard

"babel-core@npm:^7.0.0-bridge.0":
version: 7.0.0-bridge.0
resolution: "babel-core@npm:7.0.0-bridge.0"
Expand Down Expand Up @@ -12355,16 +12337,6 @@ __metadata:
languageName: node
linkType: hard

"follow-redirects@npm:^1.14.0":
version: 1.15.3
resolution: "follow-redirects@npm:1.15.3"
peerDependenciesMeta:
debug:
optional: true
checksum: 10c0/915a2cf22e667bdf47b1a43cc6b7dce14d95039e9bbf9a24d0e739abfbdfa00077dd43c86d4a7a19efefcc7a99af144920a175eedc3888d268af5df67c272ee5
languageName: node
linkType: hard

"fontfaceobserver@npm:^2.1.0":
version: 2.3.0
resolution: "fontfaceobserver@npm:2.3.0"
Expand Down Expand Up @@ -18839,15 +18811,6 @@ __metadata:
languageName: node
linkType: hard

"react-native-device-info@npm:10.3.0":
version: 10.3.0
resolution: "react-native-device-info@npm:10.3.0"
peerDependencies:
react-native: "*"
checksum: 10c0/7f10a0e50762e795a8263aafa9fe0822559e3bbf40d9f5aec6e71575739fa5460c8c4a90f18cf50de475f4f9b7d572a8140e985c2674354e15c80099b6ff379c
languageName: node
linkType: hard

"react-native-device-info@npm:13.1.0":
version: 13.1.0
resolution: "react-native-device-info@npm:13.1.0"
Expand All @@ -18857,13 +18820,6 @@ __metadata:
languageName: node
linkType: hard

"react-native-device-info@npm:^0.9.3":
version: 0.9.9
resolution: "react-native-device-info@npm:0.9.9"
checksum: 10c0/3465cba4b13622fc5488d1d6563f9f55af57fa309fdd8c9de9968c67233181d53f08a9d4f60839c56bfa9e2fdf35de15d5d393663d83b14578c00441ecc24928
languageName: node
linkType: hard

"react-native-flagsmith@npm:5.0.0":
version: 5.0.0
resolution: "react-native-flagsmith@npm:5.0.0"
Expand Down Expand Up @@ -19015,16 +18971,6 @@ __metadata:
languageName: node
linkType: hard

"react-native-siren@npm:0.0.5":
version: 0.0.5
resolution: "react-native-siren@npm:0.0.5"
dependencies:
apisauce: "npm:^2.1.1"
react-native-device-info: "npm:^0.9.3"
checksum: 10c0/2a240c3c58e1ca5394070f09d3c2aaacc389ece5a38753aa1a8c2e281ebf468409727e82e89f21b795d54dbc63c20a9e84fef4f17461954f5c2ce8aaafbea36b
languageName: node
linkType: hard

"react-native-svg@npm:15.2.0":
version: 15.2.0
resolution: "react-native-svg@npm:15.2.0"
Expand Down Expand Up @@ -19876,7 +19822,6 @@ __metadata:
react-native-toast-message: "npm:2.2.1"
semver: "npm:7.6.3"
sharp: "npm:0.31.1"
sp-react-native-in-app-updates: "npm:1.4.0"
standard-version: "npm:9.5.0"
ts-jest: "npm:29.2.5"
ts-node: "npm:10.9.2"
Expand Down Expand Up @@ -20069,15 +20014,6 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:7.2.1":
version: 7.2.1
resolution: "semver@npm:7.2.1"
bin:
semver: bin/semver.js
checksum: 10c0/db161579f627aee1f9b6193fee433e482994b1bcb8421aa346b098c44f9edb6ff6cbd948f89b2a125b1a2ec81a1d0b1b15bb680e50d1751e0d3f45b29a17f484
languageName: node
linkType: hard

"semver@npm:7.3.2":
version: 7.3.2
resolution: "semver@npm:7.3.2"
Expand Down Expand Up @@ -20617,21 +20553,6 @@ __metadata:
languageName: node
linkType: hard

"sp-react-native-in-app-updates@npm:1.4.0":
version: 1.4.0
resolution: "sp-react-native-in-app-updates@npm:1.4.0"
dependencies:
react-native-device-info: "npm:10.3.0"
react-native-siren: "npm:0.0.5"
semver: "npm:7.2.1"
underscore: "npm:1.12.1"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10c0/dedf48e81367c31296f58b035408d599bb5f3db1d2b1f0a095a7c2516f2d54b98418ee39b7703e02347113aa50ad420a4aa5a80c482c78c16c98c8e68bbb19c9
languageName: node
linkType: hard

"spdx-correct@npm:^3.0.0":
version: 3.2.0
resolution: "spdx-correct@npm:3.2.0"
Expand Down Expand Up @@ -22028,13 +21949,6 @@ __metadata:
languageName: node
linkType: hard

"underscore@npm:1.12.1":
version: 1.12.1
resolution: "underscore@npm:1.12.1"
checksum: 10c0/00f392357e363353ac485e7c156b749505087e31ff4fdad22e04ebd2f94a56fbc554cd41a6722e3895a818466cf298b1cae93ff6211d102d373a9b50db63bfd0
languageName: node
linkType: hard

"undici-types@npm:~5.26.4":
version: 5.26.5
resolution: "undici-types@npm:5.26.5"
Expand Down

0 comments on commit 4ff284b

Please sign in to comment.