more to notification system with new settings tab
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Data;
|
||||
using LightlessSync.API.Data.Enum;
|
||||
using LightlessSync.API.Dto;
|
||||
using LightlessSync.API.Dto.CharaData;
|
||||
@@ -122,36 +122,38 @@ public partial class ApiController
|
||||
// Fire and forget async operation
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var myCidHash = (await _dalamudUtil.GetCIDAsync().ConfigureAwait(false)).ToString().GetHash256();
|
||||
await TryPairWithContentId(request.HashedCid, myCidHash).ConfigureAwait(false);
|
||||
_pairRequestService.RemoveRequest(request.HashedCid);
|
||||
try
|
||||
{
|
||||
await TryPairWithContentId(request.HashedCid, myCidHash).ConfigureAwait(false);
|
||||
_pairRequestService.RemoveRequest(request.HashedCid);
|
||||
|
||||
_lightlessNotificationService.ShowNotification(
|
||||
"Pair Request Accepted",
|
||||
$"Sent a pair request back to {senderName}.",
|
||||
NotificationType.Info,
|
||||
TimeSpan.FromSeconds(3));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_lightlessNotificationService.ShowNotification(
|
||||
"Failed to Accept Pair Request",
|
||||
ex.Message,
|
||||
NotificationType.Error,
|
||||
TimeSpan.FromSeconds(5));
|
||||
Mediator.Publish(new NotificationMessage(
|
||||
"Pair Request Accepted",
|
||||
$"Sent a pair request back to {senderName}.",
|
||||
NotificationType.Info,
|
||||
TimeSpan.FromSeconds(3)));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Mediator.Publish(new NotificationMessage(
|
||||
"Failed to Accept Pair Request",
|
||||
ex.Message,
|
||||
NotificationType.Error,
|
||||
TimeSpan.FromSeconds(5)));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onDecline: () =>
|
||||
{
|
||||
_pairRequestService.RemoveRequest(request.HashedCid);
|
||||
_lightlessNotificationService.ShowNotification(
|
||||
Mediator.Publish(new NotificationMessage(
|
||||
"Pair Request Declined",
|
||||
$"Declined {senderName}'s pair request.",
|
||||
NotificationType.Info,
|
||||
TimeSpan.FromSeconds(3));
|
||||
TimeSpan.FromSeconds(3)));
|
||||
});
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user