autoupdate
This commit is contained in:
@@ -63,15 +63,15 @@ function CommonPage() {
|
|||||||
|
|
||||||
|
|
||||||
const checkUpdates = async () => {
|
const checkUpdates = async () => {
|
||||||
const currentVersion = Constants.manifest2?.extra?.expoClient?.version
|
const currentVersion = Constants.manifest2?.extra?.expoClient?.version || Constants.manifest?.version;
|
||||||
applicationApi.getVersion('assemblr').then(({latest_version}) => {
|
applicationApi.getVersion('assemblr').then(({latest_version}) => {
|
||||||
|
|
||||||
if (currentVersion == latest_version) return;
|
if (currentVersion == latest_version) return;
|
||||||
dispatch(setIndeterminate(false));
|
dispatch(setIndeterminate(false));
|
||||||
dispatch(setLoadingText("Загрузка обновления..."));
|
dispatch(setLoadingText("Загрузка обновления..."));
|
||||||
dispatch(setProgress(0));
|
dispatch(setProgress(0));
|
||||||
dispatch(openLoadingModal());
|
dispatch(openLoadingModal());
|
||||||
|
const apkPath = FileSystem.documentDirectory + "update.apk";
|
||||||
const apkPath = FileSystem.documentDirectory + "test.apk";
|
|
||||||
applicationApi.download(apkPath, 'assemblr', latest_version, data => {
|
applicationApi.download(apkPath, 'assemblr', latest_version, data => {
|
||||||
dispatch(setProgress(data.totalBytesWritten / data.totalBytesExpectedToWrite));
|
dispatch(setProgress(data.totalBytesWritten / data.totalBytesExpectedToWrite));
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user