diff --git a/SettingsPage.tsx b/SettingsPage.tsx index b9152ed..8a61560 100644 --- a/SettingsPage.tsx +++ b/SettingsPage.tsx @@ -245,9 +245,12 @@ export default function SettingsPage() { await AppDataSource.initialize() await setRepo.createQueryBuilder().update().set({image: null}).execute() await update('sound', null) + const {alarm, backup} = await settingsRepo.findOne({where: {}}) + console.log({backup}) + if (backup) NativeModules.BackupModule.start() + else NativeModules.BackupModule.stop() NativeModules.SettingsModule.ignoringBattery( async (isIgnoring: boolean) => { - const {alarm} = await settingsRepo.findOne({where: {}}) if (alarm && !isIgnoring) NativeModules.SettingsModule.ignoreBattery() reset({index: 0, routes: [{name: 'Settings'}]}) }, diff --git a/android/app/build.gradle b/android/app/build.gradle index 5cd6a98..b9358a1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -41,8 +41,8 @@ android { missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 36156 - versionName "1.130" + versionCode 36157 + versionName "1.131" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/android/app/src/main/java/com/massive/BackupModule.kt b/android/app/src/main/java/com/massive/BackupModule.kt index e4549d8..12b3b3c 100644 --- a/android/app/src/main/java/com/massive/BackupModule.kt +++ b/android/app/src/main/java/com/massive/BackupModule.kt @@ -8,6 +8,7 @@ import android.content.Intent import android.content.IntentFilter import android.os.Build import android.os.Environment +import android.util.Log import androidx.annotation.RequiresApi import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule @@ -24,6 +25,7 @@ class BackupModule constructor(context: ReactApplicationContext?) : private val copyReceiver = object : BroadcastReceiver() { @RequiresApi(Build.VERSION_CODES.O) override fun onReceive(context: Context?, intent: Intent?) { + Log.d("BackupModule", "Backing up database...") val sourceFile = File(context?.getDatabasePath("massive.db")!!.path) val targetDir = diff --git a/package.json b/package.json index 3d3d0cf..b69f51a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "massive", - "version": "1.130", + "version": "1.131", "private": true, "license": "GPL-3.0-only", "scripts": {