autoupdate
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user