fix: first comment message appear every time

This commit is contained in:
rebelonion 2024-02-15 18:45:57 -06:00
parent 68cc81e56c
commit a7c9604c43
2 changed files with 3 additions and 3 deletions

View file

@ -290,8 +290,8 @@ class CommentsActivity : AppCompatActivity() {
snackString("You are banned from commenting :(")
return@setOnClickListener
}
val firstComment = PrefManager.getVal(PrefName.FirstComment, false)
if (!firstComment) {
val firstComment = PrefManager.getVal<Boolean>(PrefName.FirstComment)
if (firstComment) {
//show a dialog explaining the rules
val alertDialog = android.app.AlertDialog.Builder(this, R.style.MyPopup)
.setTitle("Commenting Rules")

View file

@ -153,7 +153,7 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
TagsListIsAdult(Pref(Location.Irrelevant, Set::class, setOf<String>())),
TagsListNonAdult(Pref(Location.Irrelevant, Set::class, setOf<String>())),
MakeDefault(Pref(Location.Irrelevant, Boolean::class, true)),
FirstComment(Pref(Location.Irrelevant, Boolean::class, false)),
FirstComment(Pref(Location.Irrelevant, Boolean::class, true)),
//Protected
DiscordToken(Pref(Location.Protected, String::class, "")),