more to notification system with new settings tab

This commit is contained in:
choco
2025-10-08 23:20:58 +02:00
parent 17f4ddad89
commit 27e7fb7ed9
8 changed files with 963 additions and 150 deletions

View File

@@ -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;