Skip to content

Commit

Permalink
Merge pull request #284 from holzmaster/enhancement/enable-seen-sync-…
Browse files Browse the repository at this point in the history
…setting

Add setting enableItemHistory for sync of seen data with site
  • Loading branch information
mopsalarm authored Nov 16, 2023
2 parents 19243e2 + 2043a18 commit 8154f32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/com/pr0gramm/app/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ object Settings : SharedPreferences.OnSharedPreferenceChangeListener {
val highlightItemsInFeed: Boolean
get() = preferences.getBoolean("pref_highlight_items_in_feed", true)

val markItemsAsSeen: Boolean
var markItemsAsSeen: Boolean
get() = preferences.getBoolean("pref_mark_items_as_seen", false)
set(value) = edit { putBoolean("pref_mark_items_as_seen", value) }

val fancyScrollVertical: Boolean
get() = preferences.getBoolean("pref_fancy_scroll_vertical", true)
Expand Down Expand Up @@ -166,8 +167,9 @@ object Settings : SharedPreferences.OnSharedPreferenceChangeListener {
val secureApp: Boolean
get() = preferences.getBoolean("pref_secure_app", false)

val backup: Boolean
var backup: Boolean
get() = preferences.getBoolean("pref_sync_backup", true)
set(value) = edit { putBoolean("pref_sync_backup", value) }

val singleTapAction: TapAction
get() = preferences.getEnumValue("pref_single_tap_action", TapAction.NONE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class SiteSettingsService {
Settings.upvoteOnCollect = settings.favUpvote
Settings.useSecondaryServers = settings.secondaryServers
Settings.themeName = themeIdToThemeName(settings.themeId)
Settings.backup = settings.enableItemHistory
Settings.markItemsAsSeen = settings.markSeenItems
}
}

Expand All @@ -114,6 +116,8 @@ private fun localSiteSettings(): SiteSettings {
showAds = Settings.alwaysShowAds,
favUpvote = Settings.upvoteOnCollect,
secondaryServers = Settings.useSecondaryServers,
enableItemHistory = Settings.backup,
markSeenItems = Settings.markItemsAsSeen,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ data class SiteSettings(

@Json(name = "legacyPath")
val secondaryServers: Boolean,

val enableItemHistory: Boolean,
var markSeenItems: Boolean,
)

0 comments on commit 8154f32

Please sign in to comment.