From f7ca474d975f3743a792a53060deb62d811a122a Mon Sep 17 00:00:00 2001 From: 1ilit Date: Sun, 14 Jan 2024 01:16:44 +0200 Subject: [PATCH 1/2] Move to dev brach --- src/components/ControlPanel.jsx | 59 +++++++++++++++++---------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/src/components/ControlPanel.jsx b/src/components/ControlPanel.jsx index ad1342e1c..8f4e7842c 100644 --- a/src/components/ControlPanel.jsx +++ b/src/components/ControlPanel.jsx @@ -64,7 +64,7 @@ import { Editor } from "@monaco-editor/react"; import { db } from "../data/db"; import { useLiveQuery } from "dexie-react-hooks"; import { socket } from "../data/socket"; -import { useCookies } from "react-cookie"; +// import { useCookies } from "react-cookie"; import axios from "axios"; export default function ControlPanel({ @@ -110,7 +110,7 @@ export default function ControlPanel({ message: "", }); const [data, setData] = useState(null); - const [cookies] = useCookies(["logged_in"]); + // const [cookies] = useCookies(["logged_in"]); const [addPeople, setAddPeople] = useState([]) const { layout, setLayout } = useContext(LayoutContext); const { settings, setSettings } = useContext(SettingsContext); @@ -1293,26 +1293,29 @@ export default function ControlPanel({ createNewDiagram(selectedTemplateId); return; case MODAL.SHARE: - await axios - .post( - `${import.meta.env.VITE_API_BACKEND_URL}/share`, - { - people: addPeople, - diagram: { - name: title, - tables: tables, - references: relationships, - types: types, - notes: notes, - areas: areas, - } - }, - { withCredentials: true } - ) - .then((res) => { - console.log(res) - }) - .catch((e) => console.log(e)); + // if (cookies.logged_in) { + await axios + .post( + `${import.meta.env.VITE_API_BACKEND_URL}/share`, + { + people: addPeople, + diagram: JSON.stringify({ + name: title, + tables: tables, + references: relationships, + types: types, + notes: notes, + areas: areas, + }) + }, + // { withCredentials: true } + ) + .then((res) => { + console.log(res) + // window.location = window.location + '/sup' + }) + .catch((e) => console.log(e)); + // } setVisible(MODAL.NONE) return; default: @@ -1583,7 +1586,7 @@ export default function ControlPanel({ ); } case MODAL.SHARE: - if (cookies.logged_in) { + // if (cookies.logged_in) { return
Owner
- } else { - return
- You'll need to log in before you can share this diagram. -
- } + // } else { + // return
+ // You'll need to log in before you can share this diagram. + //
+ // } default: return <>; } From 9a3e048efcaaebe3df821137fb49dd7ccb35a732 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Sat, 6 Apr 2024 12:40:15 +0300 Subject: [PATCH 2/2] Update Readme --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index f768e33fc..531df4807 100644 --- a/README.md +++ b/README.md @@ -1,8 +1 @@ -# React + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +dis branch is no longer supported it's just there for backup \ No newline at end of file