@factoringplus/pl-components-pack-v3 0.4.94-pre-2 → 0.4.94-pre-3
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
|
}
|
|
@@ -44399,65 +44402,16 @@ const _sfc_main = {
|
|
|
44399
44402
|
},
|
|
44400
44403
|
setup(__props) {
|
|
44401
44404
|
const props = __props;
|
|
44402
|
-
|
|
44405
|
+
toRefs(props);
|
|
44403
44406
|
const configStore = useConfigStore();
|
|
44404
44407
|
const channelsStore = useChannelsStore();
|
|
44405
44408
|
useCommonStore();
|
|
44406
44409
|
const isHubsConnected = ref(true);
|
|
44407
|
-
const getChannelsInfo = async () => {
|
|
44408
|
-
configStore.getToken(token);
|
|
44409
|
-
configStore.getBaseUrl(baseUrl);
|
|
44410
|
-
console.log("getChannelsInfo");
|
|
44411
|
-
await Promise.all([
|
|
44412
|
-
await channelsStore.getChannels("Active"),
|
|
44413
|
-
await channelsStore.getUnreadChannels(),
|
|
44414
|
-
await channelsStore.getGroups()
|
|
44415
|
-
]);
|
|
44416
|
-
};
|
|
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
44410
|
const managerInteractionsSignalR = async () => {
|
|
44449
44411
|
console.log("managerInteractionsSignalR");
|
|
44450
44412
|
try {
|
|
44451
44413
|
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
|
-
})
|
|
44414
|
+
await configStore.connectInteractionsSignalR("FLINE")
|
|
44461
44415
|
]);
|
|
44462
44416
|
} catch (error2) {
|
|
44463
44417
|
console.log(error2);
|
|
@@ -44466,8 +44420,6 @@ const _sfc_main = {
|
|
|
44466
44420
|
const chatManagerStart = async () => {
|
|
44467
44421
|
try {
|
|
44468
44422
|
await Promise.all([
|
|
44469
|
-
getChannelsInfo(),
|
|
44470
|
-
managerChannelsSignalR(),
|
|
44471
44423
|
managerInteractionsSignalR()
|
|
44472
44424
|
]);
|
|
44473
44425
|
} catch (error2) {
|