Skip to content

Commit

Permalink
feat: update balances on dismiss of add funds view
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Dec 16, 2024
1 parent 9138bd8 commit 05995fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Assets/Shared/Scripts/UI/AddFunds/AddFunds.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
Expand All @@ -19,8 +20,12 @@ public class AddFunds : MonoBehaviour

[SerializeField] TransakView m_TransakView;

public void Show()
private Action m_OnDismiss;

public void Show(Action onDismiss)
{
m_OnDismiss = onDismiss;

m_FiatButton.onClick.RemoveListener(OnFiatButtonClicked);
m_FiatButton.onClick.AddListener(OnFiatButtonClicked);

Expand Down Expand Up @@ -61,6 +66,7 @@ private void OnCancelButtonClicked()
gameObject.SetActive(false);
m_Options.gameObject.SetActive(true);
m_TransakView.gameObject.SetActive(false);
m_OnDismiss();
}
}
}
4 changes: 3 additions & 1 deletion Assets/Shared/Scripts/UI/BalanceObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ private void TogglePanel()
/// </summary>
private void ShowAddFunds()
{
m_AddFunds.Show();
#pragma warning disable CS4014
m_AddFunds.Show(() => UpdateBalance());
#pragma warning restore CS4014
}

/// <summary>
Expand Down

0 comments on commit 05995fa

Please sign in to comment.