Remove double permissions request and fix import - 1.136
This commit is contained in:
parent
76e5aeacfd
commit
db5cc566ea
|
@ -6,7 +6,6 @@ import {NativeModules, ScrollView, View} from 'react-native'
|
||||||
import DocumentPicker from 'react-native-document-picker'
|
import DocumentPicker from 'react-native-document-picker'
|
||||||
import {Dirs, FileSystem} from 'react-native-file-access'
|
import {Dirs, FileSystem} from 'react-native-file-access'
|
||||||
import {Button, Subheading} from 'react-native-paper'
|
import {Button, Subheading} from 'react-native-paper'
|
||||||
import {PERMISSIONS, request} from 'react-native-permissions'
|
|
||||||
import ConfirmDialog from './ConfirmDialog'
|
import ConfirmDialog from './ConfirmDialog'
|
||||||
import {ITEM_PADDING, MARGIN} from './constants'
|
import {ITEM_PADDING, MARGIN} from './constants'
|
||||||
import {AppDataSource} from './data-source'
|
import {AppDataSource} from './data-source'
|
||||||
|
@ -135,12 +134,7 @@ export default function SettingsPage() {
|
||||||
return
|
return
|
||||||
case 'backup':
|
case 'backup':
|
||||||
if (value) {
|
if (value) {
|
||||||
const granted = await request(
|
|
||||||
PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE,
|
|
||||||
)
|
|
||||||
if (!granted) return
|
|
||||||
const result = await DocumentPicker.pickDirectory()
|
const result = await DocumentPicker.pickDirectory()
|
||||||
console.log(result.uri)
|
|
||||||
toast('Backup database daily.')
|
toast('Backup database daily.')
|
||||||
NativeModules.BackupModule.start(result.uri)
|
NativeModules.BackupModule.start(result.uri)
|
||||||
} else {
|
} else {
|
||||||
|
@ -247,14 +241,15 @@ export default function SettingsPage() {
|
||||||
const confirmImport = useCallback(async () => {
|
const confirmImport = useCallback(async () => {
|
||||||
setImporting(false)
|
setImporting(false)
|
||||||
await AppDataSource.destroy()
|
await AppDataSource.destroy()
|
||||||
const result = await DocumentPicker.pickSingle()
|
const file = await DocumentPicker.pickSingle()
|
||||||
await FileSystem.cp(result.uri, Dirs.DatabaseDir + '/massive.db')
|
await FileSystem.cp(file.uri, Dirs.DatabaseDir + '/massive.db')
|
||||||
await AppDataSource.initialize()
|
await AppDataSource.initialize()
|
||||||
await setRepo.createQueryBuilder().update().set({image: null}).execute()
|
await setRepo.createQueryBuilder().update().set({image: null}).execute()
|
||||||
await update('sound', null)
|
await update('sound', null)
|
||||||
const {alarm, backup} = await settingsRepo.findOne({where: {}})
|
const {alarm, backup} = await settingsRepo.findOne({where: {}})
|
||||||
console.log({backup})
|
console.log({backup})
|
||||||
if (backup) NativeModules.BackupModule.start()
|
const directory = await DocumentPicker.pickDirectory()
|
||||||
|
if (backup) NativeModules.BackupModule.start(directory.uri)
|
||||||
else NativeModules.BackupModule.stop()
|
else NativeModules.BackupModule.stop()
|
||||||
NativeModules.SettingsModule.ignoringBattery(
|
NativeModules.SettingsModule.ignoringBattery(
|
||||||
async (isIgnoring: boolean) => {
|
async (isIgnoring: boolean) => {
|
||||||
|
|
|
@ -41,8 +41,8 @@ android {
|
||||||
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
|
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 36161
|
versionCode 36162
|
||||||
versionName "1.135"
|
versionName "1.136"
|
||||||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
||||||
|
|
||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
|
|
|
@ -11,7 +11,6 @@ NativeModules.SettingsModule = NativeModules.SettingsModule || {
|
||||||
|
|
||||||
jest.mock('react-native-file-access', () => jest.fn())
|
jest.mock('react-native-file-access', () => jest.fn())
|
||||||
jest.mock('react-native-share', () => jest.fn())
|
jest.mock('react-native-share', () => jest.fn())
|
||||||
jest.mock('react-native-permissions', () => jest.fn())
|
|
||||||
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper')
|
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper')
|
||||||
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter')
|
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter')
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "massive",
|
"name": "massive",
|
||||||
"version": "1.135",
|
"version": "1.136",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -39,7 +39,6 @@
|
||||||
"react-native-linear-gradient": "^2.6.2",
|
"react-native-linear-gradient": "^2.6.2",
|
||||||
"react-native-pager-view": "^6.0.1",
|
"react-native-pager-view": "^6.0.1",
|
||||||
"react-native-paper": "^4.12.5",
|
"react-native-paper": "^4.12.5",
|
||||||
"react-native-permissions": "^3.8.0",
|
|
||||||
"react-native-reanimated": "^2.12.0",
|
"react-native-reanimated": "^2.12.0",
|
||||||
"react-native-safe-area-context": "^4.4.1",
|
"react-native-safe-area-context": "^4.4.1",
|
||||||
"react-native-screens": "^3.18.2",
|
"react-native-screens": "^3.18.2",
|
||||||
|
|
27
yarn.lock
27
yarn.lock
|
@ -7313,7 +7313,6 @@ __metadata:
|
||||||
react-native-linear-gradient: ^2.6.2
|
react-native-linear-gradient: ^2.6.2
|
||||||
react-native-pager-view: ^6.0.1
|
react-native-pager-view: ^6.0.1
|
||||||
react-native-paper: ^4.12.5
|
react-native-paper: ^4.12.5
|
||||||
react-native-permissions: ^3.8.0
|
|
||||||
react-native-reanimated: ^2.12.0
|
react-native-reanimated: ^2.12.0
|
||||||
react-native-safe-area-context: ^4.4.1
|
react-native-safe-area-context: ^4.4.1
|
||||||
react-native-screens: ^3.18.2
|
react-native-screens: ^3.18.2
|
||||||
|
@ -8593,15 +8592,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"pkg-dir@npm:^5.0.0":
|
|
||||||
version: 5.0.0
|
|
||||||
resolution: "pkg-dir@npm:5.0.0"
|
|
||||||
dependencies:
|
|
||||||
find-up: ^5.0.0
|
|
||||||
checksum: b167bb8dac7bbf22b1d5e30ec223e6b064b84b63010c9d49384619a36734caf95ed23ad23d4f9bd975e8e8082b60a83395f43a89bb192df53a7c25a38ecb57d9
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"posix-character-classes@npm:^0.1.0":
|
"posix-character-classes@npm:^0.1.0":
|
||||||
version: 0.1.1
|
version: 0.1.1
|
||||||
resolution: "posix-character-classes@npm:0.1.1"
|
resolution: "posix-character-classes@npm:0.1.1"
|
||||||
|
@ -8908,23 +8898,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-native-permissions@npm:^3.8.0":
|
|
||||||
version: 3.8.0
|
|
||||||
resolution: "react-native-permissions@npm:3.8.0"
|
|
||||||
dependencies:
|
|
||||||
picocolors: ^1.0.0
|
|
||||||
pkg-dir: ^5.0.0
|
|
||||||
peerDependencies:
|
|
||||||
react: ">=16.13.1"
|
|
||||||
react-native: ">=0.63.3"
|
|
||||||
react-native-windows: ">=0.62.0"
|
|
||||||
peerDependenciesMeta:
|
|
||||||
react-native-windows:
|
|
||||||
optional: true
|
|
||||||
checksum: acbd8605adabfc48e19fbc468a3a143fb85bd34d3ed0fe6a4b52f16304591b8a4b3c561a507c11643fcc8ce1b4dc09e31f149387d1ea461098a2e40c43989f7c
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"react-native-reanimated@npm:^2.12.0":
|
"react-native-reanimated@npm:^2.12.0":
|
||||||
version: 2.12.0
|
version: 2.12.0
|
||||||
resolution: "react-native-reanimated@npm:2.12.0"
|
resolution: "react-native-reanimated@npm:2.12.0"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user