diff --git a/src/components/molecules/actions/members.rs b/src/components/molecules/actions/members.rs index da5c98e..e79a1fb 100644 --- a/src/components/molecules/actions/members.rs +++ b/src/components/molecules/actions/members.rs @@ -49,14 +49,15 @@ pub fn MembersAction(props: VotingProps) -> Element { } }, on_change: move |event: ComboInputValue| { - let medium = match event.option { - ComboInputOption::Dropdown(value) => { - match value.key.as_str() { - "Wallet" => MediumOptions::Wallet, - _ => todo!() - } - }, - _ => todo!() + let ComboInputOption::Dropdown(value) = event.option else { + return; + }; + + let invite_wallet = translate!(i18, "onboard.invite.form.wallet.label"); + let medium = if value.key == invite_wallet { + MediumOptions::Wallet + } else { + return; }; if let ActionItem::AddMembers(ref mut meta) = initiative.get_action(props.index) { meta.members[index_meta] = MemberItem { medium, account: event.input }; diff --git a/src/components/molecules/onboarding/invite.rs b/src/components/molecules/onboarding/invite.rs index a84fb8d..2a12898 100644 --- a/src/components/molecules/onboarding/invite.rs +++ b/src/components/molecules/onboarding/invite.rs @@ -59,14 +59,15 @@ pub fn OnboardingInvite() -> Element { MediumOptions::Wallet => translate!(i18, "onboard.invite.form.wallet.placeholder"), }, on_change: move |event: ComboInputValue| { - let medium = match event.option { - ComboInputOption::Dropdown(value) => { - match value.key.as_str() { - "Wallet" => MediumOptions::Wallet, - _ => todo!() - } - }, - _ => todo!() + let ComboInputOption::Dropdown(value) = event.option else { + return; + }; + + let invite_wallet = translate!(i18, "onboard.invite.form.wallet.label"); + let medium = if value.key == invite_wallet { + MediumOptions::Wallet + } else { + return; }; onboard.update_invitation(index, InvitationItem { medium, account: event.input });