ui fixes
This commit is contained in:
parent
c97477ec48
commit
f4f0e5275e
@ -506,7 +506,7 @@ function sendMessage(message) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
socket.addEventListener("message", (event) => {
|
socket.addEventListener("message", (event) => {
|
||||||
previousVolume = displayCallVolume + displayPutVolume || 0;
|
const totalVolume = displayCallVolume + displayPutVolume;
|
||||||
if (mode === true) {
|
if (mode === true) {
|
||||||
try {
|
try {
|
||||||
newData = JSON.parse(event.data) ?? [];
|
newData = JSON.parse(event.data) ?? [];
|
||||||
@ -515,17 +515,16 @@ function sendMessage(message) {
|
|||||||
item.dte = daysLeft(item?.date_expiration);
|
item.dte = daysLeft(item?.date_expiration);
|
||||||
});
|
});
|
||||||
|
|
||||||
calculateStats(newData);
|
//calculateStats(newData);
|
||||||
//console.log(previousVolume);
|
//console.log(previousVolume);
|
||||||
if (
|
if (
|
||||||
newData?.length > rawData?.length &&
|
newData?.length > rawData?.length &&
|
||||||
previousVolume !== displayCallVolume + displayPutVolume
|
previousVolume !== totalVolume
|
||||||
) {
|
) {
|
||||||
//console.log(previousVolume,displayCallVolume + displayPutVolume,);
|
//console.log(previousVolume,totalVolume,);
|
||||||
rawData = newData;
|
rawData = newData;
|
||||||
displayedData = rawData;
|
displayedData = rawData;
|
||||||
|
|
||||||
newData = [];
|
|
||||||
if (
|
if (
|
||||||
!muted &&
|
!muted &&
|
||||||
ruleOfList?.length === 0 &&
|
ruleOfList?.length === 0 &&
|
||||||
@ -536,10 +535,6 @@ function sendMessage(message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ruleOfList?.length !== 0 || filterQuery?.length !== 0) {
|
|
||||||
shouldLoadWorker.set(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (previousCallVolume !== displayCallVolume && !muted && audio) {
|
if (previousCallVolume !== displayCallVolume && !muted && audio) {
|
||||||
audio?.play();
|
audio?.play();
|
||||||
@ -548,6 +543,8 @@ function sendMessage(message) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error processing WebSocket message:", e);
|
console.error("Error processing WebSocket message:", e);
|
||||||
}
|
}
|
||||||
|
newData = [];
|
||||||
|
previousVolume = totalVolume;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -601,6 +598,10 @@ function sendMessage(message) {
|
|||||||
if (filterQuery?.length > 0) {
|
if (filterQuery?.length > 0) {
|
||||||
shouldLoadWorker.set(true);
|
shouldLoadWorker.set(true);
|
||||||
}
|
}
|
||||||
|
if (ruleOfList?.length !== 0) {
|
||||||
|
shouldLoadWorker.set(true);
|
||||||
|
console.log("initial filter");
|
||||||
|
}
|
||||||
|
|
||||||
displayRules = allRows?.filter((row) =>
|
displayRules = allRows?.filter((row) =>
|
||||||
ruleOfList?.some((rule) => rule?.name === row?.rule),
|
ruleOfList?.some((rule) => rule?.name === row?.rule),
|
||||||
@ -625,11 +626,6 @@ function sendMessage(message) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ruleOfList?.length !== 0) {
|
|
||||||
shouldLoadWorker.set(true);
|
|
||||||
console.log("initial filter");
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -288,7 +288,6 @@ onmessage = async (event: MessageEvent) => {
|
|||||||
// Filter the data
|
// Filter the data
|
||||||
let filteredData = await filterRawData(rawData, ruleOfList, filterQuery);
|
let filteredData = await filterRawData(rawData, ruleOfList, filterQuery);
|
||||||
|
|
||||||
console.log(ruleOfList)
|
|
||||||
filteredData = Array.from(
|
filteredData = Array.from(
|
||||||
new Map(filteredData?.map((item) => [item?.id, item]))?.values()
|
new Map(filteredData?.map((item) => [item?.id, item]))?.values()
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user