mute: fix bug where mutes can't be added without existing mutelist

There is currently an issue where if a user doesn’t have an existing
mutelist it won’t let the user add new mute items. This patch fixes that
by not including the existing mutelist variable in the guard statement.

Lighting-address: fishcharlie@strike.me
Signed-off-by: Charlie Fish <contact@charlie.fish>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Charlie Fish
2024-01-27 13:43:58 -07:00
committed by William Casarin
parent a6b508c25a
commit d5606aabca

View File

@@ -72,9 +72,10 @@ struct AddMuteItemView: View {
// Actually update & relay the new mute list
if let mute_item {
let existing_mutelist = state.contacts.mutelist
guard
let full_keypair = state.keypair.to_full(),
let existing_mutelist = state.contacts.mutelist,
let mutelist = create_or_update_mutelist(keypair: full_keypair, mprev: existing_mutelist, to_add: mute_item)
else {
return