Update reset viewer flags strings

This commit is contained in:
arkon 2022-05-12 09:04:02 -04:00
parent 08fb2fe467
commit 5dc688dc2e
3 changed files with 10 additions and 12 deletions

View file

@ -3,7 +3,7 @@ package eu.kanade.domain.manga.interactor
import eu.kanade.domain.manga.repository.MangaRepository
class ResetViewerFlags(
private val mangaRepository: MangaRepository
private val mangaRepository: MangaRepository,
) {
suspend fun await(): Boolean {
return mangaRepository.resetViewerFlags()

View file

@ -25,7 +25,6 @@ import eu.kanade.tachiyomi.ui.base.controller.pushController
import eu.kanade.tachiyomi.ui.setting.database.ClearDatabaseController
import eu.kanade.tachiyomi.util.CrashLogUtil
import eu.kanade.tachiyomi.util.lang.launchIO
import eu.kanade.tachiyomi.util.lang.withIOContext
import eu.kanade.tachiyomi.util.lang.withUIContext
import eu.kanade.tachiyomi.util.preference.bindTo
import eu.kanade.tachiyomi.util.preference.defaultValue
@ -46,7 +45,6 @@ import eu.kanade.tachiyomi.util.system.logcat
import eu.kanade.tachiyomi.util.system.powerManager
import eu.kanade.tachiyomi.util.system.setDefaultSettings
import eu.kanade.tachiyomi.util.system.toast
import kotlinx.coroutines.runBlocking
import logcat.LogPriority
import rikka.sui.Sui
import uy.kohesive.injekt.Injekt
@ -56,7 +54,7 @@ import java.io.File
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
class SettingsAdvancedController(
private val mangaRepository: MangaRepository = Injekt.get()
private val mangaRepository: MangaRepository = Injekt.get(),
) : SettingsController() {
private val network: NetworkHelper by injectLazy()
@ -325,14 +323,14 @@ class SettingsAdvancedController(
private fun resetViewerFlags() {
val activity = activity ?: return
launchIO {
val isSuccesful = mangaRepository.resetViewerFlags()
val success = mangaRepository.resetViewerFlags()
withUIContext {
val resouurceString = if (isSuccesful) {
R.string.pref_reset_viewer_flags_succesful
val message = if (success) {
R.string.pref_reset_viewer_flags_success
} else {
R.string.pref_reset_viewer_flags_unsuccesful
R.string.pref_reset_viewer_flags_error
}
activity.toast(resouurceString)
activity.toast(message)
}
}
}

View file

@ -486,10 +486,10 @@
<string name="pref_refresh_library_covers">Refresh library manga covers</string>
<string name="pref_refresh_library_tracking">Refresh tracking</string>
<string name="pref_refresh_library_tracking_summary">Updates status, score and last chapter read from the tracking services</string>
<string name="pref_reset_viewer_flags">Reset Viewer Flags</string>
<string name="pref_reset_viewer_flags">Reset viewer flags</string>
<string name="pref_reset_viewer_flags_summary">Resets reading mode and orientation of all series</string>
<string name="pref_reset_viewer_flags_succesful">Viewer flags reset was succesful</string>
<string name="pref_reset_viewer_flags_unsuccesful">Couldn\'t reset viewer flags</string>
<string name="pref_reset_viewer_flags_success">Viewer flags reset</string>
<string name="pref_reset_viewer_flags_error">Couldn\'t reset viewer flags</string>
<string name="pref_dump_crash_logs">Dump crash logs</string>
<string name="pref_dump_crash_logs_summary">Saves error logs to a file for sharing with the developers</string>
<string name="crash_log_saved">Crash logs saved</string>