@factoringplus/pl-components-pack-v3 0.4.94-pre-5 → 0.4.94-pre-6
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.
|
@@ -44211,6 +44211,9 @@ const useConfigStore = defineStore("config", {
|
|
|
44211
44211
|
baseUrl: ""
|
|
44212
44212
|
}),
|
|
44213
44213
|
getters: {
|
|
44214
|
+
channelsConnectionHub: (state) => new HubConnectionBuilder().withUrl(`${state.baseUrl}/v2/channels`, {
|
|
44215
|
+
accessTokenFactory: () => `${state.token}`
|
|
44216
|
+
}).configureLogging(LogLevel.Information).build(),
|
|
44214
44217
|
interactionsConnectionHub: (state) => new HubConnectionBuilder().withUrl(`${state.baseUrl}/v2/interactions`, {
|
|
44215
44218
|
accessTokenFactory: () => `${state.token}`
|
|
44216
44219
|
}).configureLogging(LogLevel.Information).build()
|
|
@@ -44225,11 +44228,6 @@ const useConfigStore = defineStore("config", {
|
|
|
44225
44228
|
api(optionsRequest) {
|
|
44226
44229
|
return ApiJs(optionsRequest, false, `Bearer ${this.token}`, true);
|
|
44227
44230
|
},
|
|
44228
|
-
channelsConnectionHub() {
|
|
44229
|
-
return new HubConnectionBuilder().withUrl(`${this.baseUrl}/v2/channels`, {
|
|
44230
|
-
accessTokenFactory: () => `${this.token}`
|
|
44231
|
-
}).configureLogging(LogLevel.Information).build();
|
|
44232
|
-
},
|
|
44233
44231
|
async connectChannelsSignalR(channelId) {
|
|
44234
44232
|
let startedPromise = null;
|
|
44235
44233
|
async function start() {
|
|
@@ -44248,7 +44246,6 @@ const useConfigStore = defineStore("config", {
|
|
|
44248
44246
|
}
|
|
44249
44247
|
},
|
|
44250
44248
|
async connectInteractionsSignalR(groupId) {
|
|
44251
|
-
console.log("this.interactionsConnectionHub", this.interactionsConnectionHub);
|
|
44252
44249
|
let startedPromise = null;
|
|
44253
44250
|
const start = async () => {
|
|
44254
44251
|
startedPromise = await this.interactionsConnectionHub.start().catch((err) => {
|
|
@@ -44425,9 +44422,29 @@ const _sfc_main = {
|
|
|
44425
44422
|
console.log(error2);
|
|
44426
44423
|
}
|
|
44427
44424
|
};
|
|
44425
|
+
const managerChannelsSignalR = async () => {
|
|
44426
|
+
console.log("managerChannelsSignalR");
|
|
44427
|
+
console.log("channelsStore.notifications.activeChannels.length", channelsStore.notifications.activeChannels.length);
|
|
44428
|
+
if (channelsStore.notifications.activeChannels.length) {
|
|
44429
|
+
console.log("is channels active");
|
|
44430
|
+
try {
|
|
44431
|
+
await Promise.all(channelsStore.notifications.activeChannels.map(async (channel) => {
|
|
44432
|
+
await configStore.connectChannelsSignalR(channel.channelId);
|
|
44433
|
+
await configStore.channelsConnectionHub.on("MessageAddedNotification", async (message2) => {
|
|
44434
|
+
console.log("MessageAddedNotificationManager", message2);
|
|
44435
|
+
await updateChannels();
|
|
44436
|
+
});
|
|
44437
|
+
await configStore.channelsConnectionHub.on("MessagesReadNotification", (message2) => {
|
|
44438
|
+
console.log("MessagesReadNotification", message2);
|
|
44439
|
+
updateChannels();
|
|
44440
|
+
});
|
|
44441
|
+
}));
|
|
44442
|
+
} catch (error2) {
|
|
44443
|
+
console.log(error2);
|
|
44444
|
+
}
|
|
44445
|
+
}
|
|
44446
|
+
};
|
|
44428
44447
|
const managerInteractionsSignalR = async () => {
|
|
44429
|
-
console.log("configStore", configStore.interactionsConnectionHub);
|
|
44430
|
-
console.log("managerInteractionsSignalR");
|
|
44431
44448
|
try {
|
|
44432
44449
|
await Promise.all([
|
|
44433
44450
|
await configStore.connectInteractionsSignalR("FLINE"),
|
|
@@ -44448,6 +44465,7 @@ const _sfc_main = {
|
|
|
44448
44465
|
try {
|
|
44449
44466
|
await Promise.all([
|
|
44450
44467
|
getChannelsInfo(),
|
|
44468
|
+
managerChannelsSignalR(),
|
|
44451
44469
|
managerInteractionsSignalR()
|
|
44452
44470
|
]);
|
|
44453
44471
|
} catch (error2) {
|