ui fixes
This commit is contained in:
parent
1e0c87b378
commit
c213b48090
@ -27,43 +27,43 @@
|
||||
let path;
|
||||
switch (sector) {
|
||||
case "Financials":
|
||||
path = "financial-sector";
|
||||
path = "financial";
|
||||
break;
|
||||
case "Healthcare":
|
||||
path = "healthcare-sector";
|
||||
path = "healthcare";
|
||||
break;
|
||||
case "Information Technology":
|
||||
path = "technology-sector";
|
||||
path = "technology";
|
||||
break;
|
||||
case "Technology":
|
||||
path = "technology-sector";
|
||||
path = "technology";
|
||||
break;
|
||||
case "Financial Services":
|
||||
path = "financial-sector";
|
||||
path = "financial";
|
||||
break;
|
||||
case "Industrials":
|
||||
path = "industrials-sector";
|
||||
path = "industrials";
|
||||
break;
|
||||
case "Energy":
|
||||
path = "energy-sector";
|
||||
path = "energy";
|
||||
break;
|
||||
case "Utilities":
|
||||
path = "utilities-sector";
|
||||
path = "utilities";
|
||||
break;
|
||||
case "Consumer Cyclical":
|
||||
path = "consumer-cyclical-sector";
|
||||
path = "consumer-cyclical";
|
||||
break;
|
||||
case "Real Estate":
|
||||
path = "real-estate-sector";
|
||||
path = "real-estate";
|
||||
break;
|
||||
case "Basic Materials":
|
||||
path = "basic-materials-sector";
|
||||
path = "basic-materials";
|
||||
break;
|
||||
case "Communication Services":
|
||||
path = "communication-services-sector";
|
||||
path = "communication-services";
|
||||
break;
|
||||
case "Consumer Defensive":
|
||||
path = "consumer-defensive-sector";
|
||||
path = "consumer-defensive";
|
||||
break;
|
||||
default:
|
||||
// Handle default case if needed
|
||||
@ -693,13 +693,13 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each rawData?.topSectors as item}
|
||||
{#each Object.entries(item) as [name, value]}
|
||||
{#each Object?.entries(item) as [name, value]}
|
||||
<tr
|
||||
class="text-white sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] bg-[#141417] border-b border-[#141417]"
|
||||
>
|
||||
<td class="text-[1rem] whitespace-nowrap">
|
||||
<a
|
||||
href={"/list/" + sectorSelector(name)}
|
||||
href={"/list/sector/" + sectorSelector(name)}
|
||||
class="text-blue-400 sm:hover:text-white"
|
||||
>
|
||||
{name}
|
||||
|
||||
@ -363,8 +363,8 @@
|
||||
|
||||
let audio;
|
||||
let muted = false;
|
||||
let newIncomingData = false;
|
||||
let previousCallVolume = 0; //This is needed to play the sound only if it changes.
|
||||
let newData = [];
|
||||
let previousVolume = 0; //This is needed to play the sound only if it changes.
|
||||
let notFound = false;
|
||||
let isLoaded = false;
|
||||
let mode = $isOpen === true ? true : false;
|
||||
@ -457,7 +457,7 @@ function sendMessage(message) {
|
||||
*/
|
||||
|
||||
async function websocketRealtimeData() {
|
||||
let newData = [];
|
||||
newData = [];
|
||||
try {
|
||||
socket = new WebSocket(data?.wsURL + "/options-flow-reader");
|
||||
/*
|
||||
@ -468,7 +468,7 @@ function sendMessage(message) {
|
||||
*/
|
||||
|
||||
socket.addEventListener("message", (event) => {
|
||||
previousCallVolume = displayCallVolume ?? 0;
|
||||
previousVolume = displayCallVolume + displayPutVolume || 0;
|
||||
if (mode === true) {
|
||||
try {
|
||||
newData = JSON.parse(event.data) ?? [];
|
||||
@ -479,7 +479,13 @@ function sendMessage(message) {
|
||||
if (newData?.length > rawData?.length) {
|
||||
rawData = newData;
|
||||
displayedData = rawData;
|
||||
if (!muted) {
|
||||
|
||||
newData = [];
|
||||
if (
|
||||
!muted &&
|
||||
ruleOfList?.length === 0 &&
|
||||
filterQuery?.length === 0
|
||||
) {
|
||||
audio?.play();
|
||||
}
|
||||
}
|
||||
@ -804,7 +810,7 @@ function sendMessage(message) {
|
||||
ruleToUpdate.value = valueMappings[ruleToUpdate.name];
|
||||
ruleToUpdate.condition = ruleCondition[ruleToUpdate.name];
|
||||
ruleOfList = [...ruleOfList];
|
||||
shouldLoadWorker.set(true);
|
||||
//shouldLoadWorker.set(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -928,6 +934,23 @@ function sendMessage(message) {
|
||||
// Sort using the appropriate comparison function
|
||||
displayedData = originalData.sort(compareFunctions[key]);
|
||||
}
|
||||
|
||||
$: {
|
||||
if (
|
||||
previousVolume !== displayCallVolume + displayPutVolume &&
|
||||
typeof window !== "undefined" &&
|
||||
newData?.length !== 0
|
||||
) {
|
||||
if (
|
||||
!muted &&
|
||||
mode &&
|
||||
(ruleOfList?.length !== 0 || filterQuery?.length !== 0)
|
||||
) {
|
||||
audio?.play();
|
||||
console.log("sound for filtered list");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user