Skip to content

Commit

Permalink
feat: address minor comments from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
thoreyjona committed Oct 2, 2024
1 parent c9f9e2b commit d75a062
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/native/app/src/screens/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const MainHomeScreen: NavigationFunctionComponent = ({
const keyExtractor = useCallback((item: ListItem) => item.id, [])
const scrollY = useRef(new Animated.Value(0)).current

const checkAppVersion = useCallback(async () => {
const isAppUpdateRequired = useCallback(async () => {
const needsUpdate = await needsToUpdateAppVersion()
if (needsUpdate) {
navigateTo('/update-app', { closable: false })
Expand All @@ -270,7 +270,7 @@ export const MainHomeScreen: NavigationFunctionComponent = ({
// Get user locale from server
getAndSetLocale()
// Check if upgrade wall should be shown
checkAppVersion()
isAppUpdateRequired()
}, [])

const refetch = useCallback(async () => {
Expand Down
5 changes: 2 additions & 3 deletions apps/native/app/src/screens/update-app/update-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { preferencesStore } from '../../stores/preferences-store'
const Text = styled.View`
margin-horizontal: ${({ theme }) => theme.spacing[7]}px;
text-align: center;
margin-bottom: ${({ theme }) => theme.spacing[5]}px;
margin-top: ${({ theme }) => theme.spacing[5]}px;
margin-vertical: ${({ theme }) => theme.spacing[5]}px;
`

const Host = styled.View`
Expand Down Expand Up @@ -95,7 +94,7 @@ export const UpdateAppScreen: NavigationFunctionComponent<{
</Title>
<Typography textAlign="center">
<FormattedMessage
id={'updateApp.description'}
id="updateApp.description"
defaultMessage={
'Þú ert að fara að nota gamla útgáfu af Ísland.is appinu. Vinsamlegast uppfærðu appið til að halda áfram.'
}
Expand Down
1 change: 1 addition & 0 deletions apps/native/app/src/utils/minimum-app-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const needsToUpdateAppVersion = async (): Promise<boolean> => {

const currentVersion = DeviceInfo.getVersion()

// @example compare('2.0.0', '1.5.0', '>') => true (update needed)
return compareVersions.compare(minimumVersionSupported, currentVersion, '>')
}

0 comments on commit d75a062

Please sign in to comment.