Skip to content

Commit

Permalink
refactor: removed unnecessary libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Aug 22, 2024
1 parent 985ad90 commit 61bbacd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 83 deletions.
22 changes: 10 additions & 12 deletions app/AppSettingsMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { rawdb } from '@db'
import { copyFile, DocumentDirectoryPath, DownloadDirectoryPath } from '@dr.pogodin/react-native-fs'
import { Style, AppSettings, Logger, Characters } from '@globals'
import { reloadAppAsync } from 'expo'
import { getDocumentAsync } from 'expo-document-picker'
import { documentDirectory, copyAsync, deleteAsync } from 'expo-file-system'
import { Stack, useRouter } from 'expo-router'
import React from 'react'
import { StyleSheet, Text, View, Switch, TouchableOpacity, Alert, ScrollView } from 'react-native'
import ReactNativeBlobUtil from 'react-native-blob-util'
import { useMMKVBoolean } from 'react-native-mmkv'

const appVersion = `${require(`../app.json`).expo.version}`
Expand Down Expand Up @@ -55,17 +55,15 @@ const WarningAlert = (title: string, description: string, onPress: () => void) =
}

const exportDB = async () => {
ReactNativeBlobUtil.MediaCollection.copyToMediaStore(
{
name: `${appVersion}-db-backup.db`,
parentFolder: '',
mimeType: 'application/x-sqlite3',
},
'Download',
`${documentDirectory}SQLite/db.db`
).then(() => {
Logger.log('Download Successful!', true)
})
console.log(`${DocumentDirectoryPath}/SQLite/db.db`)
await copyFile(
`${DocumentDirectoryPath}/SQLite/db.db`,
`${DownloadDirectoryPath}/${appVersion}-db-backup.db`
)
.then(() => {
Logger.log('Download Successful!', true)
})
.catch((e) => Logger.log('Failed to copy database: ' + e, true))
}

const importDB = async (uri: string, name: string) => {
Expand Down
70 changes: 0 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"react-compiler-runtime": "file:./lib/react-compiler-runtime",
"react-native": "^0.74.3",
"react-native-background-actions": "^4.0.1",
"react-native-blob-util": "^0.19.9",
"react-native-collapsible": "^1.6.1",
"react-native-element-dropdown": "^2.10.0",
"react-native-gesture-handler": "~2.16.1",
Expand Down

0 comments on commit 61bbacd

Please sign in to comment.