diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt index f287b8308..3f0c9839e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt @@ -393,7 +393,14 @@ class Config(context: Context) : BaseConfig(context) { var rememberLastVideoPosition: Boolean get() = prefs.getBoolean(REMEMBER_LAST_VIDEO_POSITION, false) - set(rememberLastVideoPosition) = prefs.edit().putBoolean(REMEMBER_LAST_VIDEO_POSITION, rememberLastVideoPosition).apply() + set(rememberLastVideoPosition) { + if (!rememberLastVideoPosition) { + getAllLastVideoPositions().forEach { + prefs.edit().remove(it.key).apply() + } + } + prefs.edit().putBoolean(REMEMBER_LAST_VIDEO_POSITION, rememberLastVideoPosition).apply() + } var visibleBottomActions: Int get() = prefs.getInt(VISIBLE_BOTTOM_ACTIONS, DEFAULT_BOTTOM_ACTIONS)