autoupdate

This commit is contained in:
2023-11-21 05:33:20 +03:00
parent 2a795fcd33
commit e5ea497851

View File

@@ -63,15 +63,15 @@ function CommonPage() {
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}) => {
if (currentVersion == latest_version) return;
dispatch(setIndeterminate(false));
dispatch(setLoadingText("Загрузка обновления..."));
dispatch(setProgress(0));
dispatch(openLoadingModal());
const apkPath = FileSystem.documentDirectory + "test.apk";
const apkPath = FileSystem.documentDirectory + "update.apk";
applicationApi.download(apkPath, 'assemblr', latest_version, data => {
dispatch(setProgress(data.totalBytesWritten / data.totalBytesExpectedToWrite));
}).then(() => {