Added new notification nuget. Added auto regenerate JWT token on error.

This commit is contained in:
Patrick Fic
2020-07-24 11:14:51 -07:00
parent e8c58dab2f
commit 32ec745c77
8 changed files with 123 additions and 48 deletions

View File

@@ -13,6 +13,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Firebase.Auth;
using ToastNotifications.Messages;
namespace BodyshopPartner.ViewModels
{
@@ -20,6 +21,9 @@ namespace BodyshopPartner.ViewModels
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
/* * */
public MainViewModel()
{
logger.Trace("Main VM constructed.");
@@ -76,10 +80,8 @@ namespace BodyshopPartner.ViewModels
LoadBodyshopData().Wait(); ;
_callingThread.ReportProgress(80);
Utils.HTTPServer.InitHttpServer(AddHttpStatus);
logger.Debug("VM Init Complete");
Task.Run(() => Utils.HTTPServer.InitHttpServer(AddHttpStatus));
_callingThread.ReportProgress(100);
}
@@ -106,7 +108,7 @@ namespace BodyshopPartner.ViewModels
{
logger.Debug("Adding folder {0} to monitoring paths.", dialog.SelectedPath);
MonitoringPaths.Add(new Models.Monitor() { FilePath = dialog.SelectedPath });
Properties.Settings.Default.MonitoringPaths = MonitoringPaths.Select(x => x.FilePath).ToList(); ;
Properties.Settings.Default.MonitoringPaths = MonitoringPaths.Select(x => x.FilePath).ToList();
Properties.Settings.Default.Save();
}
}
@@ -226,14 +228,18 @@ namespace BodyshopPartner.ViewModels
private FirebaseAuthLink al = BodyshopPartner.Utils.Auth.authlink;
public async Task TestGql()
{
Notification _n = new Notification()
{
Id = new Random().Next(),
Title = "This is a title",
Subtitle = "Subtitle",
Message = "Somethin"
};
Growler.AddNotification(_n);
Utils.Notifications.notifier.ShowInformation("The message");
//Notification _n = new Notification()
//{
// Id = new Random().Next(),
// Title = "This is a title",
// Subtitle = "Subtitle",
// Message = "Somethin"
//};
//Growler.AddNotification(_n);
Console.WriteLine(al.FirebaseToken);
FirebaseAuthLink t = await al.GetFreshAuthAsync();