Skip to content

Commit

Permalink
Load confirmations only once form is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessecar96 committed Jun 28, 2023
1 parent 6ce732e commit 4d0603a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Steam Desktop Authenticator/ConfirmationFormWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public ConfirmationFormWeb(SteamGuardAccount steamAccount)
InitializeComponent();
this.steamAccount = steamAccount;
this.Text = String.Format("Trade Confirmations - {0}", steamAccount.AccountName);

LoadData();
}
private async Task LoadData()
{
Expand Down Expand Up @@ -140,5 +138,16 @@ private async void btnRefresh_Click(object sender, EventArgs e)
this.btnRefresh.Enabled = true;
this.btnRefresh.Text = "Refresh";
}

private async void ConfirmationFormWeb_Shown(object sender, EventArgs e)
{
this.btnRefresh.Enabled = false;
this.btnRefresh.Text = "Refreshing...";

await this.LoadData();

this.btnRefresh.Enabled = true;
this.btnRefresh.Text = "Refresh";
}
}
}
15 changes: 2 additions & 13 deletions Steam Desktop Authenticator/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,8 @@ private void btnTradeConfirmations_Click(object sender, EventArgs e)
btnTradeConfirmations.Text = "Loading...";
btnTradeConfirmations.Text = oText;

try
{
ConfirmationFormWeb confirms = new ConfirmationFormWeb(currentAccount);
confirms.Show();
}
catch (Exception)
{
DialogResult res = MessageBox.Show("You are missing a dependency required to view your trade confirmations.\nWould you like to install it now?", "Trade confirmations failed to open", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes)
{
new InstallRedistribForm(true).ShowDialog();
}
}
ConfirmationFormWeb confirms = new ConfirmationFormWeb(currentAccount);
confirms.Show();
}

private void btnManageEncryption_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 4d0603a

Please sign in to comment.