From bd3fa871b40e225f27cbdddd529e9b10a2a0842c Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 1 Sep 2022 16:26:48 +0500 Subject: [PATCH] mobile: refactor & remove version.js file --- .../app/components/sheets/github/issue.js | 8 +++++--- .../components/sheets/new-feature/index.tsx | 12 +++++------ .../app/screens/settings/settings-data.tsx | 5 +++-- apps/mobile/app/stores/use-message-store.ts | 8 ++++---- apps/mobile/app/stores/use-setting-store.ts | 2 +- apps/mobile/app/version.js | 20 ------------------- 6 files changed, 19 insertions(+), 36 deletions(-) delete mode 100644 apps/mobile/app/version.js diff --git a/apps/mobile/app/components/sheets/github/issue.js b/apps/mobile/app/components/sheets/github/issue.js index eea3bd819..7c719eeb0 100644 --- a/apps/mobile/app/components/sheets/github/issue.js +++ b/apps/mobile/app/components/sheets/github/issue.js @@ -20,6 +20,7 @@ along with this program. If not, see . import Clipboard from "@react-native-clipboard/clipboard"; import React, { useRef, useState } from "react"; import { Linking, Platform, Text, TextInput, View } from "react-native"; +import { getVersion } from "react-native-device-info"; import { db } from "../../../common/database"; import { eSendEvent, ToastEvent } from "../../../services/event-manager"; import PremiumService from "../../../services/premium"; @@ -29,7 +30,6 @@ import { eCloseProgressDialog } from "../../../utils/events"; import { openLinkInBrowser } from "../../../utils/functions"; import { SIZE } from "../../../utils/size"; import { sleep } from "../../../utils/time"; -import { APP_VERSION } from "../../../version"; import DialogHeader from "../../dialog/dialog-header"; import { presentDialog } from "../../dialog/functions"; import { Button } from "../../ui/button"; @@ -59,7 +59,7 @@ export const Issue = ({ defaultTitle, defaultBody, issueTitle }) => { body.current + `\n_______________ **Device information:** -App version: ${APP_VERSION} +App version: ${getVersion()} Platform: ${Platform.OS} Model: ${Platform.constants.Brand || ""}-${Platform.constants.Model || ""}-${ Platform.constants.Version || "" @@ -187,7 +187,9 @@ For example: {`App version: ${APP_VERSION} Platform: ${Platform.OS} Model: ${Platform.constants.Brand}-${Platform.constants.Model}-${Platform.constants.Version}`} + >{`App version: ${getVersion()} Platform: ${Platform.OS} Model: ${ + Platform.constants.Brand + }-${Platform.constants.Model}-${Platform.constants.Version}`}