fix: update currentflow to be fetched from Flow Store for icon to be rendered correctly (#7354)

* Updated current flow to be fetched from FlowStore

* Changed setPlaygroundPage's place because of console error
This commit is contained in:
Lucas Oliveira 2025-03-31 12:00:51 -03:00 committed by GitHub
commit 57524d538c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 8 deletions

View file

@ -67,10 +67,8 @@ export default function IOModal({
const currentFlowId = playgroundPage
? uuidv5(`${clientId}_${realFlowId}`, uuidv5.DNS)
: realFlowId;
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const currentFlow = useFlowStore((state) => state.currentFlow);
const [sidebarOpen, setSidebarOpen] = useState(true);
const setPlaygroundPage = useFlowStore((state) => state.setPlaygroundPage);
setPlaygroundPage(!!playgroundPage);
const { mutate: deleteSessionFunction } = useDeleteMessages();
const [visibleSession, setvisibleSession] = useState<string | undefined>(

View file

@ -3,17 +3,13 @@ import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
import { track } from "@/customization/utils/analytics";
import IOModal from "@/modals/IOModal/new-modal";
import useFlowStore from "@/stores/flowStore";
import { useStoreStore } from "@/stores/storeStore";
import { useUtilityStore } from "@/stores/utilityStore";
import { CookieOptions, getCookie, setCookie } from "@/utils/utils";
import { useEffect } from "react";
import { useParams } from "react-router-dom";
import { v4 as uuid } from "uuid";
import { getComponent } from "../../controllers/API";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
import cloneFLowWithParent, {
getInputsAndOutputs,
} from "../../utils/storeUtils";
import { getInputsAndOutputs } from "../../utils/storeUtils";
export default function PlaygroundPage() {
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
const currentSavedFlow = useFlowsManagerStore((state) => state.currentFlow);
@ -26,6 +22,7 @@ export default function PlaygroundPage() {
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
const setIsLoading = useFlowsManagerStore((state) => state.setIsLoading);
const setPlaygroundPage = useFlowStore((state) => state.setPlaygroundPage);
async function getFlowData() {
try {
@ -56,6 +53,7 @@ export default function PlaygroundPage() {
useEffect(() => {
if (id) track("Playground Page Loaded", { flowId: id });
setPlaygroundPage(true);
}, []);
useEffect(() => {