Skip to content

Commit

Permalink
Set default value for pref_auto_print_badges_option, because on some …
Browse files Browse the repository at this point in the history
…devices the defaultValue on the preference doesn't apply
  • Loading branch information
robbi5 committed Dec 13, 2024
1 parent 18e7e07 commit 93da27d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class AppConfig(ctx: Context) : ConfigStore {
.remove(PREFS_KEY_LEGACY_AUTOPRINTBADGES)
.commit()
}
if (!prefs.contains(PREFS_KEY_AUTOPRINTBADGES)) {
prefs.edit()
.putString(PREFS_KEY_AUTOPRINTBADGES, "once")
.commit()
}
}

override fun isDebug(): Boolean {
Expand Down
2 changes: 1 addition & 1 deletion pretixscan/app/src/main/res/xml/app_restrictions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:restrictionType="bool"
android:title="@string/preference_badgeprint_enable" />
<restriction
android:defaultValue="false"
android:defaultValue="once"
android:key="pref_auto_print_badges_option"
android:dependency="pref_print_badges"
android:restrictionType="choice"
Expand Down

0 comments on commit 93da27d

Please sign in to comment.