mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-22 05:12:58 +12:00
Add a bit of exception handling to headpats/hugs buttons
This commit is contained in:
parent
a6321a9ecc
commit
8160521d10
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
@ -49,13 +50,33 @@ namespace VRCMelonAssistant.Pages
|
|||
}
|
||||
|
||||
private async Task HeadPat()
|
||||
{
|
||||
try
|
||||
{
|
||||
PatImage.Load(await WeebCDN("pats"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Utils.ShowErrorMessageBox("Oops! Can't get headpats right now!", ex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Hug()
|
||||
{
|
||||
try
|
||||
{
|
||||
HugImage.Load(await WeebCDN("hugs"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Utils.ShowErrorMessageBox("Oops! Can't get hugs right now!", ex);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue