From e4a12cfd285b83ca81f7987ba1b25d21adcd430d Mon Sep 17 00:00:00 2001 From: mdrlzy Date: Wed, 18 Jan 2023 05:23:16 +0600 Subject: [PATCH] Minor fixes --- app/build.gradle | 2 +- .../mvp/model/repo/stats/category/StatsCategoryStorage.kt | 8 +++++++- app/src/main/res/layout/dialog_info.xml | 2 +- app/src/main/res/values/strings.xml | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 931f8654..aa356e31 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -104,7 +104,7 @@ dependencies { implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0' implementation 'com.github.MikeOrtiz:TouchImageView:3.1.1' - implementation 'com.github.ARK-Builders:ark-filepicker:252f27e7f2' + implementation 'com.github.ARK-Builders:ark-filepicker:c6d66141c1' implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2" diff --git a/app/src/main/java/space/taran/arknavigator/mvp/model/repo/stats/category/StatsCategoryStorage.kt b/app/src/main/java/space/taran/arknavigator/mvp/model/repo/stats/category/StatsCategoryStorage.kt index 044b431f..6cab98b3 100644 --- a/app/src/main/java/space/taran/arknavigator/mvp/model/repo/stats/category/StatsCategoryStorage.kt +++ b/app/src/main/java/space/taran/arknavigator/mvp/model/repo/stats/category/StatsCategoryStorage.kt @@ -9,6 +9,7 @@ import kotlinx.coroutines.launch import space.taran.arklib.arkFolder import space.taran.arklib.arkStats import space.taran.arknavigator.mvp.model.repo.stats.StatsEvent +import timber.log.Timber import java.nio.file.Path private const val FLUSH_INTERVAL = 10_000L @@ -20,7 +21,12 @@ abstract class StatsCategoryStorage( abstract val fileName: String private val flushFlow = MutableSharedFlow().also { flow -> flow.debounce(FLUSH_INTERVAL).onEach { - flush() + // There may be an exception after root is removed + try { + flush() + } catch (e: Exception) { + Timber.e(e) + } }.launchIn(scope) } diff --git a/app/src/main/res/layout/dialog_info.xml b/app/src/main/res/layout/dialog_info.xml index 6986c26f..42bef8b5 100644 --- a/app/src/main/res/layout/dialog_info.xml +++ b/app/src/main/res/layout/dialog_info.xml @@ -34,7 +34,7 @@ android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginEnd="16dp" - android:text="@string/delete_folder" + android:text="@string/delete_files" android:visibility="gone" /> Pin Unpin Scores - %1$s resource score%2$s will be erased. + %1$d resource score%2$s will be erased. Utils Navigator will forget the folder and all its children - Delete folder from memory + Delete files