From a18f50f2502ea616ee2a9c8fe26e0d60e4dc5896 Mon Sep 17 00:00:00 2001 From: Charlie Fish Date: Sat, 10 Feb 2024 09:36:49 -0700 Subject: [PATCH] mute: fix mute hashtag from search view if no existing mutelist There is a bug where if a user creates a new account and tries to mute a hashtag from the search view it will fail silently. This is due to the fact that the user has no existing mutelist. Lighting-Address: fishcharlie@strike.me Signed-off-by: Charlie Fish Reviewed-by: William Casarin Link: 20240210163650.42884-5-contact@charlie.fish Signed-off-by: William Casarin --- damus/Views/SearchView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/damus/Views/SearchView.swift b/damus/Views/SearchView.swift index 083225ab..fc7d582e 100644 --- a/damus/Views/SearchView.swift +++ b/damus/Views/SearchView.swift @@ -94,9 +94,10 @@ struct SearchView: View { } func mute_hashtag(hashtag_string: String, expiration_time: Date?) { + let existing_mutelist = appstate.mutelist_manager.event + guard let full_keypair = appstate.keypair.to_full(), - let existing_mutelist = appstate.mutelist_manager.event, let mutelist = create_or_update_mutelist(keypair: full_keypair, mprev: existing_mutelist, to_add: .hashtag(Hashtag(hashtag: hashtag_string), expiration_time)) else { return