bugfixing
This commit is contained in:
parent
e27fdca117
commit
1bcec757e6
@ -7,7 +7,7 @@ export const load = async ({ params, locals, setHeaders }) => {
|
|||||||
|
|
||||||
const getIndustryStocks = async () => {
|
const getIndustryStocks = async () => {
|
||||||
|
|
||||||
const postData = { ticker: params.slug };
|
const postData = { "filterList": params.slug };
|
||||||
const response = await fetch(apiURL + "/industry-stocks", {
|
const response = await fetch(apiURL + "/industry-stocks", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@ -23,14 +23,13 @@ export const load = async ({ params, locals, setHeaders }) => {
|
|||||||
//output = user?.tier !== "Pro" ? output?.slice(0, 5) : output;
|
//output = user?.tier !== "Pro" ? output?.slice(0, 5) : output;
|
||||||
|
|
||||||
//output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output;
|
//output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output;
|
||||||
|
console.log(output)
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Make sure to return a promise
|
// Make sure to return a promise
|
||||||
return {
|
return {
|
||||||
getParams: await getParams(),
|
getParams: await getParams(),
|
||||||
|
|
||||||
getIndustryStocks: await getIndustryStocks(),
|
getIndustryStocks: await getIndustryStocks(),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -484,11 +484,21 @@ function sendMessage(message) {
|
|||||||
if (mode === true) {
|
if (mode === true) {
|
||||||
try {
|
try {
|
||||||
newData = JSON.parse(event.data) ?? [];
|
newData = JSON.parse(event.data) ?? [];
|
||||||
if (newData?.length !== 0) {
|
if (newData?.length > 0) {
|
||||||
newData.forEach((item) => {
|
newData?.forEach((item) => {
|
||||||
item.dte = daysLeft(item?.date_expiration);
|
item.dte = daysLeft(item?.date_expiration);
|
||||||
});
|
});
|
||||||
if (newData?.length > rawData?.length) {
|
|
||||||
|
calculateStats(newData);
|
||||||
|
console.log(previousVolume);
|
||||||
|
if (
|
||||||
|
newData?.length > rawData?.length &&
|
||||||
|
previousVolume !== displayCallVolume + displayPutVolume
|
||||||
|
) {
|
||||||
|
console.log(
|
||||||
|
previousVolume,
|
||||||
|
displayCallVolume + displayPutVolume,
|
||||||
|
);
|
||||||
rawData = newData;
|
rawData = newData;
|
||||||
displayedData = rawData;
|
displayedData = rawData;
|
||||||
|
|
||||||
@ -954,23 +964,6 @@ function sendMessage(message) {
|
|||||||
// Sort using the appropriate comparison function
|
// Sort using the appropriate comparison function
|
||||||
displayedData = originalData.sort(compareFunctions[key]);
|
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>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user