@factoringplus/pl-components-pack-v3 0.4.94-pre-2 → 0.4.94-pre-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44248,9 +44248,12 @@ const useConfigStore = defineStore("config", {
|
|
|
44248
44248
|
}).configureLogging(LogLevel.Information).build();
|
|
44249
44249
|
},
|
|
44250
44250
|
async connectInteractionsSignalR(groupId) {
|
|
44251
|
+
const signalRTest = new HubConnectionBuilder().withUrl(`${this.baseUrl}/v2/interactions`, {
|
|
44252
|
+
accessTokenFactory: () => `${this.token}`
|
|
44253
|
+
}).configureLogging(LogLevel.Information).build();
|
|
44251
44254
|
let startedPromise = null;
|
|
44252
44255
|
async function start() {
|
|
44253
|
-
startedPromise = await
|
|
44256
|
+
startedPromise = await signalRTest.start().catch((err) => {
|
|
44254
44257
|
console.error("Failed to connect with hub", err);
|
|
44255
44258
|
return new Promise((res, rej) => setTimeout(() => start().then(res).catch(rej), 5e3));
|
|
44256
44259
|
});
|
|
@@ -44259,7 +44262,7 @@ const useConfigStore = defineStore("config", {
|
|
|
44259
44262
|
}
|
|
44260
44263
|
try {
|
|
44261
44264
|
await start();
|
|
44262
|
-
await
|
|
44265
|
+
await signalRTest.invoke("Join", groupId);
|
|
44263
44266
|
} catch (err) {
|
|
44264
44267
|
console.error(err.toString());
|
|
44265
44268
|
}
|
|
@@ -44414,50 +44417,11 @@ const _sfc_main = {
|
|
|
44414
44417
|
await channelsStore.getGroups()
|
|
44415
44418
|
]);
|
|
44416
44419
|
};
|
|
44417
|
-
const updateChannels = async () => {
|
|
44418
|
-
try {
|
|
44419
|
-
await Promise.all([
|
|
44420
|
-
await channelsStore.getChannels(channelsStore.channelCategory),
|
|
44421
|
-
await channelsStore.getUnreadChannels()
|
|
44422
|
-
]);
|
|
44423
|
-
} catch (error2) {
|
|
44424
|
-
console.log(error2);
|
|
44425
|
-
}
|
|
44426
|
-
};
|
|
44427
|
-
const managerChannelsSignalR = async () => {
|
|
44428
|
-
console.log("managerChannelsSignalR");
|
|
44429
|
-
if (channelsStore.notifications.activeChannels.length) {
|
|
44430
|
-
console.log("is channels active");
|
|
44431
|
-
try {
|
|
44432
|
-
await Promise.all(channelsStore.notifications.activeChannels.map(async (channel) => {
|
|
44433
|
-
await configStore.connectChannelsSignalR(channel.channelId);
|
|
44434
|
-
await configStore.channelsConnectionHub.on("MessageAddedNotification", async (message2) => {
|
|
44435
|
-
console.log("MessageAddedNotificationManager", message2);
|
|
44436
|
-
await updateChannels();
|
|
44437
|
-
});
|
|
44438
|
-
await configStore.channelsConnectionHub.on("MessagesReadNotification", (message2) => {
|
|
44439
|
-
console.log("MessagesReadNotification", message2);
|
|
44440
|
-
updateChannels();
|
|
44441
|
-
});
|
|
44442
|
-
}));
|
|
44443
|
-
} catch (error2) {
|
|
44444
|
-
console.log(error2);
|
|
44445
|
-
}
|
|
44446
|
-
}
|
|
44447
|
-
};
|
|
44448
44420
|
const managerInteractionsSignalR = async () => {
|
|
44449
44421
|
console.log("managerInteractionsSignalR");
|
|
44450
44422
|
try {
|
|
44451
44423
|
await Promise.all([
|
|
44452
|
-
await configStore.connectInteractionsSignalR("FLINE")
|
|
44453
|
-
await configStore.interactionsConnectionHub.on("InteractionAddedNotification", (message2) => {
|
|
44454
|
-
console.log("InteractionAddedNotification", message2);
|
|
44455
|
-
updateChannels();
|
|
44456
|
-
}),
|
|
44457
|
-
await configStore.interactionsConnectionHub.on("InteractionChangedNotification", (message2) => {
|
|
44458
|
-
console.log("InteractionChangedNotification", message2);
|
|
44459
|
-
updateChannels();
|
|
44460
|
-
})
|
|
44424
|
+
await configStore.connectInteractionsSignalR("FLINE")
|
|
44461
44425
|
]);
|
|
44462
44426
|
} catch (error2) {
|
|
44463
44427
|
console.log(error2);
|
|
@@ -44467,7 +44431,6 @@ const _sfc_main = {
|
|
|
44467
44431
|
try {
|
|
44468
44432
|
await Promise.all([
|
|
44469
44433
|
getChannelsInfo(),
|
|
44470
|
-
managerChannelsSignalR(),
|
|
44471
44434
|
managerInteractionsSignalR()
|
|
44472
44435
|
]);
|
|
44473
44436
|
} catch (error2) {
|