Skip to content

Commit 4c9f352

Browse files
committed
bugfix[#33]: restore behaviour
1 parent c37fd83 commit 4c9f352

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

domain/src/main/java/com/androidvip/sysctlgui/domain/usecase/ImportParamsUseCase.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ class ImportParamsUseCase(
1717
fileExtension: String
1818
): Result<List<DomainKernelParam>> {
1919
return runCatching {
20+
val isBackup = fileExtension.endsWith(".conf")
2021
val importResult = when {
2122
fileExtension.endsWith(".json") -> repository.importParamsFromJson(stream)
22-
fileExtension.endsWith(".conf") -> repository.importParamsFromConf(stream)
23+
isBackup -> repository.importParamsFromConf(stream)
2324
else -> throw InvalidFileExtensionException()
2425
}
2526

@@ -36,7 +37,11 @@ class ImportParamsUseCase(
3637
}
3738

3839
clearUserParamUseCase.execute()
39-
addUserParamsUseCase.execute(successfulParams)
40+
41+
// Prevent adding full backups to the apply-on-boot list
42+
if (!isBackup) {
43+
addUserParamsUseCase.execute(successfulParams)
44+
}
4045

4146
successfulParams
4247
}

0 commit comments

Comments
 (0)