diff --git a/jsconfig.json b/jsconfig.json
deleted file mode 100644
index f1da068b..00000000
--- a/jsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "./.svelte-kit/tsconfig.json",
- "compilerOptions": {
- "allowJs": true,
- "checkJs": true,
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "resolveJsonModule": true,
- "skipLibCheck": true,
- "sourceMap": true,
- "strict": true
- }
- // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
- //
- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
- // from the referenced tsconfig.json - TypeScript does not merge them in
-}
diff --git a/src/lib/components/Table/OptionsFlowTable.svelte b/src/lib/components/Table/OptionsFlowTable.svelte
index 4dce71ba..67610f38 100644
--- a/src/lib/components/Table/OptionsFlowTable.svelte
+++ b/src/lib/components/Table/OptionsFlowTable.svelte
@@ -237,7 +237,13 @@
@@ -584,7 +590,11 @@
let:index
let:style
{style}
- class="tr {index % 2 === 0 ? 'bg-odd' : 'bg-[#17171D]'}"
+ class="tr {index % 2 === 0 ? 'bg-[#19191F]' : 'bg-[#121217]'} {index +
+ 1 ===
+ rawData?.length && data?.user?.tier !== 'Pro'
+ ? 'opacity-[0.3]'
+ : ''}"
>
@@ -791,7 +801,6 @@
.th {
display: none;
font-weight: 700;
- background-color: #09090b;
}
.th > .td {
diff --git a/src/routes/options-flow/+page.server.ts b/src/routes/options-flow/+page.server.ts
index 60709bf0..5005860d 100644
--- a/src/routes/options-flow/+page.server.ts
+++ b/src/routes/options-flow/+page.server.ts
@@ -10,7 +10,8 @@ export const load = async ({ locals, cookies }) => {
"X-API-KEY": apiKey,
},
});
- const output = await response.json();
+ let output = await response.json();
+ output = user?.tier !== "Pro" ? output?.slice(0, 6) : output;
return output;
};
diff --git a/src/routes/options-flow/+page.svelte b/src/routes/options-flow/+page.svelte
index a20b4e76..c5c2c339 100644
--- a/src/routes/options-flow/+page.svelte
+++ b/src/routes/options-flow/+page.svelte
@@ -16,6 +16,7 @@
import { Button } from "$lib/components/shadcn/button/index.js";
import { Calendar } from "$lib/components/shadcn/calendar/index.js";
import CalendarIcon from "lucide-svelte/icons/calendar";
+ import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import { page } from "$app/stores";
@@ -529,78 +530,74 @@
}
async function websocketRealtimeData() {
- newData = [];
- try {
- socket = new WebSocket(data?.wsURL + "/options-flow-reader");
- /*
- socket.addEventListener("open", () => {
- const ids = rawData.map(item => item.id);
- sendMessage(JSON.stringify({ ids }));
- });
- */
+ if (data?.user?.tier === "Pro") {
+ newData = [];
+ try {
+ socket = new WebSocket(data?.wsURL + "/options-flow-reader");
- socket.addEventListener("message", (event) => {
- const totalVolume = displayCallVolume + displayPutVolume;
- if (mode === true) {
- try {
- newData = JSON?.parse(event.data) ?? [];
- if (newData?.length > 0) {
- newData?.forEach((item) => {
- item.dte = daysLeft(item?.date_expiration);
- });
+ socket.addEventListener("message", (event) => {
+ const totalVolume = displayCallVolume + displayPutVolume;
+ if (mode === true) {
+ try {
+ newData = JSON?.parse(event.data) ?? [];
+ if (newData?.length > 0) {
+ newData?.forEach((item) => {
+ item.dte = daysLeft(item?.date_expiration);
+ });
- //calculateStats(newData);
- //console.log(previousVolume);
- if (
- newData?.length > rawData?.length &&
- previousVolume !== totalVolume
- ) {
- //console.log(previousVolume,totalVolume,);
- rawData = newData;
- shouldLoadWorker.set(true);
- //console.log('loading worker')
- //displayedData = rawData;
+ //calculateStats(newData);
+ //console.log(previousVolume);
+ if (
+ newData?.length > rawData?.length &&
+ previousVolume !== totalVolume
+ ) {
+ //console.log(previousVolume,totalVolume,);
+ rawData = newData;
+ shouldLoadWorker.set(true);
+ //console.log('loading worker')
+ //displayedData = rawData;
- if (!muted) {
- audio?.play();
+ if (!muted) {
+ audio?.play();
+ }
}
}
- }
- /*
+ /*
if (previousCallVolume !== displayCallVolume && !muted && audio) {
audio?.play();
}
*/
- } catch (e) {
- console.error("Error processing WebSocket message:", e);
+ } catch (e) {
+ console.error("Error processing WebSocket message:", e);
+ }
+ newData = [];
+ previousVolume = totalVolume;
}
- newData = [];
- previousVolume = totalVolume;
- }
- });
+ });
- socket.addEventListener("close", (event) => {
- console.log("WebSocket connection closed:", event.reason);
+ socket.addEventListener("close", (event) => {
+ console.log("WebSocket connection closed:", event.reason);
- // Explicitly nullify the socket and remove all event listeners
- if (socket) {
- socket.onmessage = null;
- socket.onopen = null;
- socket.onclose = null;
- socket.onerror = null;
- socket = null;
- }
- });
+ // Explicitly nullify the socket and remove all event listeners
+ if (socket) {
+ socket.onmessage = null;
+ socket.onopen = null;
+ socket.onclose = null;
+ socket.onerror = null;
+ socket = null;
+ }
+ });
- socket.addEventListener("error", (error) => {
- console.error("WebSocket error:", error);
- // Handle WebSocket errors here
- });
- } catch (error) {
- console.error("WebSocket connection error:", error);
- // Handle connection errors here
- setTimeout(() => websocketRealtimeData(), 400);
+ socket.addEventListener("error", (error) => {
+ console.error("WebSocket error:", error);
+ // Handle WebSocket errors here
+ });
+ } catch (error) {
+ console.error("WebSocket connection error:", error);
+ // Handle connection errors here
+ setTimeout(() => websocketRealtimeData(), 400);
+ }
}
}
@@ -1668,6 +1665,7 @@
{filteredData}
{rawData}
/>
+
{:else}
{/if}
-
-
{:else}