Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#174119099] Display app version #2122

Merged
merged 6 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ts/utils/__tests__/appVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ jest.mock("react-native-device-info", () => {
.mockReturnValueOnce("1.1.3")
.mockReturnValueOnce("1.1.9")
.mockReturnValueOnce("1.2.3.4"),
getVersion: jest
.fn()
.mockReturnValueOnce("1.1.3")
.mockReturnValueOnce("1.1.9")
.mockReturnValueOnce("1.2.3.4"),
getBuildNumber: () => 3
};
});
Expand Down
6 changes: 5 additions & 1 deletion ts/utils/appVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const isVersionAppSupported = (
return semSatisfies;
};

export const getAppVersion = () => DeviceInfo.getReadableVersion();
export const getAppVersion = () =>
Platform.select({
ios: DeviceInfo.getReadableVersion(),
default: DeviceInfo.getVersion()
});

/**
* return true if the app must be updated
Expand Down