From 451409fc3baefea8138dfff44e415cad64f784ee Mon Sep 17 00:00:00 2001 From: "Yevhen Babiichuk (DustDFG)" Date: Mon, 9 Feb 2026 22:54:28 +0200 Subject: [PATCH] SharedPreferences.edit applies changes automatically --- .../java/org/schabi/newpipe/local/feed/FeedViewModel.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedViewModel.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedViewModel.kt index 7e781b30f..58ec818f3 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedViewModel.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedViewModel.kt @@ -129,8 +129,7 @@ class FeedViewModel( fun setSaveShowPlayedItems(showPlayedItems: Boolean) { this.showPlayedItems.onNext(showPlayedItems) PreferenceManager.getDefaultSharedPreferences(application).edit { - this.putBoolean(application.getString(R.string.feed_show_watched_items_key), showPlayedItems) - this.apply() + putBoolean(application.getString(R.string.feed_show_watched_items_key), showPlayedItems) } } @@ -139,8 +138,7 @@ class FeedViewModel( fun setSaveShowPartiallyPlayedItems(showPartiallyPlayedItems: Boolean) { this.showPartiallyPlayedItems.onNext(showPartiallyPlayedItems) PreferenceManager.getDefaultSharedPreferences(application).edit { - this.putBoolean(application.getString(R.string.feed_show_partially_watched_items_key), showPartiallyPlayedItems) - this.apply() + putBoolean(application.getString(R.string.feed_show_partially_watched_items_key), showPartiallyPlayedItems) } } @@ -149,8 +147,7 @@ class FeedViewModel( fun setSaveShowFutureItems(showFutureItems: Boolean) { this.showFutureItems.onNext(showFutureItems) PreferenceManager.getDefaultSharedPreferences(application).edit { - this.putBoolean(application.getString(R.string.feed_show_future_items_key), showFutureItems) - this.apply() + putBoolean(application.getString(R.string.feed_show_future_items_key), showFutureItems) } }