From d9ce88b841f8dfc6eb8a0aff63f09c43c47da8b3 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 11 Sep 2020 14:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E6=99=AF=E9=85=8D=E7=BD=AE=E8=87=AA?= =?UTF-8?q?=E7=94=B1=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/ReadBookConfig.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 8eadae8ed..d6c89a647 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -106,9 +106,14 @@ object ReadBookConfig { fun save() { Coroutine.async { synchronized(this) { - val json = GSON.toJson(configList) - FileUtils.deleteFile(configFilePath) - FileUtils.createFileIfNotExist(configFilePath).writeText(json) + GSON.toJson(configList).let { + FileUtils.deleteFile(configFilePath) + FileUtils.createFileIfNotExist(configFilePath).writeText(it) + } + GSON.toJson(shareConfig).let { + FileUtils.deleteFile(shareConfigFilePath) + FileUtils.createFileIfNotExist(shareConfigFilePath).writeText(it) + } } } }