mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed #764
This commit is contained in:
parent
3bad9cad5e
commit
8bbb20557f
1 changed files with 10 additions and 3 deletions
|
@ -29,7 +29,7 @@ import java.text.SimpleDateFormat
|
|||
import java.util.*
|
||||
|
||||
object BackupUtils {
|
||||
var restoreFileSelector: ActivityResultLauncher<String>? = null
|
||||
var restoreFileSelector: ActivityResultLauncher<Array<String>>? = null
|
||||
|
||||
// Kinda hack, but I couldn't think of a better way
|
||||
data class BackupVars(
|
||||
|
@ -143,7 +143,7 @@ object BackupUtils {
|
|||
fun FragmentActivity.setUpBackup() {
|
||||
try {
|
||||
restoreFileSelector =
|
||||
registerForActivityResult(ActivityResultContracts.GetContent()) { uri: Uri? ->
|
||||
registerForActivityResult(ActivityResultContracts.OpenDocument()) { uri: Uri? ->
|
||||
this.let { activity ->
|
||||
uri?.let {
|
||||
try {
|
||||
|
@ -180,7 +180,14 @@ object BackupUtils {
|
|||
|
||||
fun FragmentActivity.restorePrompt() {
|
||||
runOnUiThread {
|
||||
restoreFileSelector?.launch("application/json")
|
||||
restoreFileSelector?.launch(
|
||||
arrayOf(
|
||||
"text/plain",
|
||||
"text/str",
|
||||
"text/x-unknown",
|
||||
"application/json"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue