Run automatic backups after database imports - 1.131
This commit is contained in:
parent
13b340f5be
commit
79a48b1e47
|
@ -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'}]})
|
||||
},
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "massive",
|
||||
"version": "1.130",
|
||||
"version": "1.131",
|
||||
"private": true,
|
||||
"license": "GPL-3.0-only",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user