From d5482cd50d5f7fc536fa9be432206eb7bed6aa66 Mon Sep 17 00:00:00 2001 From: shahid <105579118+Shahidullah-Muffakir@users.noreply.github.com> Date: Wed, 7 Feb 2024 19:30:46 +0530 Subject: [PATCH 1/4] fix: Zoom label not updating on selection/input (#389) * fix: Zoom label not updating on selection/input --- src/containers/Views/GraphView/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/containers/Views/GraphView/index.tsx b/src/containers/Views/GraphView/index.tsx index 0f8fdb2c0cd..d8771d39b1b 100644 --- a/src/containers/Views/GraphView/index.tsx +++ b/src/containers/Views/GraphView/index.tsx @@ -1,6 +1,7 @@ import React from "react"; import dynamic from "next/dynamic"; import styled from "styled-components"; +import debounce from "lodash.debounce"; import { toast } from "react-hot-toast"; import { Space } from "react-zoomable-ui"; import { ElkRoot } from "reaflow/dist/layout/useLayout"; @@ -96,7 +97,6 @@ const GraphCanvas = ({ isWidget }: GraphProps) => { const direction = useGraph(state => state.direction); const nodes = useGraph(state => state.nodes); const edges = useGraph(state => state.edges); - const [paneWidth, setPaneWidth] = React.useState(2000); const [paneHeight, setPaneHeight] = React.useState(2000); @@ -156,6 +156,7 @@ function getViewType(nodes: NodeData[]) { export const Graph = ({ isWidget = false }: GraphProps) => { const setViewPort = useGraph(state => state.setViewPort); + const viewPort = useGraph(state => state.viewPort); const loading = useGraph(state => state.loading); const isPremium = useUser(state => state.premium); const viewType = useGraph(state => getViewType(state.nodes)); @@ -192,6 +193,9 @@ export const Graph = ({ isWidget = false }: GraphProps) => { if (viewType === "premium" && !isWidget) { if (!isPremium) return ; } + const debouncedOnZoomChangeHandler = debounce(() => { + setViewPort(viewPort!); + }, 300); return ( <> @@ -205,6 +209,7 @@ export const Graph = ({ isWidget = false }: GraphProps) => { {...bindLongPress()} > debouncedOnZoomChangeHandler()} onCreate={setViewPort} onContextMenu={e => e.preventDefault()} treatTwoFingerTrackPadGesturesLikeTouch={gesturesEnabled} From a9fb242e231f761917f601765d0afe52b85aee15 Mon Sep 17 00:00:00 2001 From: areeb1501 <64038736+areeb1501@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:44:14 +0400 Subject: [PATCH 2/4] Added missing Command (#391) The command pnpm is incorrect. Instead it must be pnpm install to intall the dependencies of the project. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c72e16575d5..9031dab07da 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Here is what you need to be able to run JSON Crack. 3. Install packages with yarn ```sh - pnpm + pnpm install ``` 4. Run the project From dbc198ce85632eeb93a2c40e936b34d0b240e45f Mon Sep 17 00:00:00 2001 From: Ofer Shaal Date: Thu, 8 Feb 2024 02:44:42 -0500 Subject: [PATCH 3/4] Fixing grammar and spelling mistake (#390) --- src/containers/Views/GraphView/PremiumView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/Views/GraphView/PremiumView.tsx b/src/containers/Views/GraphView/PremiumView.tsx index ecc8fe9266e..367dfd74ca4 100644 --- a/src/containers/Views/GraphView/PremiumView.tsx +++ b/src/containers/Views/GraphView/PremiumView.tsx @@ -159,7 +159,7 @@ export const PremiumView = () => ( - Upgrade JSON Crack to premium and explore full potantial of your data! + Upgrade JSON Crack to premium and explore the full potential of your data! Date: Mon, 12 Feb 2024 11:17:09 +0300 Subject: [PATCH 4/4] chore: replace with new sub check --- src/store/useUser.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/useUser.ts b/src/store/useUser.ts index 612686da3c6..4d1df30d974 100644 --- a/src/store/useUser.ts +++ b/src/store/useUser.ts @@ -30,14 +30,15 @@ const initialStates: UserStates = { const useUser = create()(set => ({ ...initialStates, setSession: async session => { - supabase.rpc("get_subscription_info").then(({ data }) => { + supabase.rpc("get_subscription_details").then(({ data }) => { if (data) { set({ premium: data.premium, - organization: data.organization, + organization: data.orgPremium, premiumCancelled: !!data.cancelled, - orgAdmin: data.org_admin, + orgAdmin: data.orgAdmin, }); + ReactGA.set({ tier: data.premium ? "premium" : "free" }); }