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 postData = { ticker: params.slug };
|
||||
const postData = { "filterList": params.slug };
|
||||
const response = await fetch(apiURL + "/industry-stocks", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@ -23,14 +23,13 @@ export const load = async ({ params, locals, setHeaders }) => {
|
||||
//output = user?.tier !== "Pro" ? output?.slice(0, 5) : output;
|
||||
|
||||
//output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output;
|
||||
|
||||
console.log(output)
|
||||
return output;
|
||||
};
|
||||
|
||||
// Make sure to return a promise
|
||||
return {
|
||||
getParams: await getParams(),
|
||||
|
||||
getIndustryStocks: await getIndustryStocks(),
|
||||
};
|
||||
};
|
||||
|
||||
@ -484,11 +484,21 @@ function sendMessage(message) {
|
||||
if (mode === true) {
|
||||
try {
|
||||
newData = JSON.parse(event.data) ?? [];
|
||||
if (newData?.length !== 0) {
|
||||
newData.forEach((item) => {
|
||||
if (newData?.length > 0) {
|
||||
newData?.forEach((item) => {
|
||||
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;
|
||||
displayedData = rawData;
|
||||
|
||||
@ -954,23 +964,6 @@ 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