mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
fix: export amnezia config bug
This commit is contained in:
+1
@@ -107,6 +107,7 @@ fun TunnelsScreen(viewModel: TunnelsViewModel) {
|
||||
if (showExportSheet) {
|
||||
ExportTunnelsBottomSheet({ type, uri ->
|
||||
sharedViewModel.exportSelectedTunnels(type, uri)
|
||||
showExportSheet = false
|
||||
}) {
|
||||
showExportSheet = false
|
||||
sharedViewModel.clearSelectedTunnels()
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ fun ExportTunnelsBottomSheet(
|
||||
mimeType = FileUtils.ZIP_FILE_MIME_TYPE,
|
||||
onResult = { file ->
|
||||
if (file != null) {
|
||||
onExport(ConfigType.WG, file)
|
||||
onExport(exportConfigType, file)
|
||||
} else onDismiss()
|
||||
},
|
||||
)
|
||||
|
||||
@@ -270,6 +270,10 @@ constructor(
|
||||
.onSuccess {
|
||||
fileUtils.zipAll(it, files).onFailure(onFailure)
|
||||
fileUtils.exportFile(it, uri, FileUtils.ZIP_FILE_MIME_TYPE).onFailure(onFailure)
|
||||
postSideEffect(
|
||||
GlobalSideEffect.Snackbar(StringValue.StringResource(R.string.export_success))
|
||||
)
|
||||
clearSelectedTunnels()
|
||||
}
|
||||
.onFailure(onFailure)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user