File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
app/src/main/java/com/raival/compose/file/explorer/screen/preferences Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -266,10 +266,18 @@ class PreferencesManager {
266266 }
267267
268268 fun setViewConfigPrefsFor (content : ContentHolder , prefs : ViewConfigs ) {
269- runBlocking {
270- globalClass.prefDataStore.edit {
271- it[stringPreferencesKey(" viewConfigPrefs_${content.uniquePath} " )] =
272- prefs.toJson()
269+ if (prefs == getDefaultViewConfigPrefs()) {
270+ runBlocking {
271+ globalClass.prefDataStore.edit {
272+ it.remove(stringPreferencesKey(" viewConfigPrefs_${content.uniquePath} " ))
273+ }
274+ }
275+ } else {
276+ runBlocking {
277+ globalClass.prefDataStore.edit {
278+ it[stringPreferencesKey(" viewConfigPrefs_${content.uniquePath} " )] =
279+ prefs.toJson()
280+ }
273281 }
274282 }
275283 }
You can’t perform that action at this time.
0 commit comments