diff --git a/.cursor/rules/rules.mdc b/.cursor/rules/rules.mdc deleted file mode 100644 index a31ed33..0000000 --- a/.cursor/rules/rules.mdc +++ /dev/null @@ -1,5 +0,0 @@ ---- -alwaysApply: true ---- - -Никогда самостоятельно не пытайся запустить сервер. Если это требуется, то попроси это сделать меня! \ No newline at end of file diff --git a/.cursor/rules/start-server-rule.mdc b/.cursor/rules/start-server-rule.mdc new file mode 100644 index 0000000..bdd398e --- /dev/null +++ b/.cursor/rules/start-server-rule.mdc @@ -0,0 +1,5 @@ +--- +alwaysApply: true +--- + +Never try to start the server yourself. If it is required, then ask me to do it! diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index a703257..289ef10 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -2,13 +2,11 @@ import React, { useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { Icon } from "@iconify/react"; import { useAppSelector, useAppDispatch } from "../../store/hooks"; -import { clearAuth } from "../../store/slices/authSlice"; import { setSelectedDate, setSelectedTag, setSearchQuery, } from "../../store/slices/notesSlice"; -import { authApi } from "../../api/authApi"; import { userApi } from "../../api/userApi"; import { ThemeToggle } from "../common/ThemeToggle"; import { setUser, setAiSettings } from "../../store/slices/profileSlice"; @@ -26,7 +24,6 @@ export const Header: React.FC = ({ }) => { const navigate = useNavigate(); const dispatch = useAppDispatch(); - const username = useAppSelector((state) => state.auth.username); const user = useAppSelector((state) => state.profile.user); const selectedDate = useAppSelector((state) => state.notes.selectedDate); const selectedTag = useAppSelector((state) => state.notes.selectedTag); @@ -63,18 +60,6 @@ export const Header: React.FC = ({ } }; - const handleLogout = async () => { - try { - await authApi.logout(); - dispatch(clearAuth()); - navigate("/"); - } catch (error) { - console.error("Ошибка выхода:", error); - dispatch(clearAuth()); - navigate("/"); - } - }; - const handleClearFilters = () => { dispatch(setSelectedDate(null)); dispatch(setSelectedTag(null)); @@ -156,9 +141,6 @@ export const Header: React.FC = ({ > - diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 800462b..8a87862 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -240,18 +240,35 @@ const ProfilePage: React.FC = () => {
+
diff --git a/src/pages/SettingsPage.tsx b/src/pages/SettingsPage.tsx index 7d7d32f..a7b8842 100644 --- a/src/pages/SettingsPage.tsx +++ b/src/pages/SettingsPage.tsx @@ -3,10 +3,12 @@ import { useNavigate } from "react-router-dom"; import { Icon } from "@iconify/react"; import { useAppSelector, useAppDispatch } from "../store/hooks"; import { userApi } from "../api/userApi"; +import { authApi } from "../api/authApi"; import { notesApi, logsApi, Log } from "../api/notesApi"; import { Note } from "../types/note"; import { setUser, setAiSettings } from "../store/slices/profileSlice"; import { setAccentColor as setAccentColorAction } from "../store/slices/uiSlice"; +import { clearAuth } from "../store/slices/authSlice"; import { setAccentColor } from "../utils/colorUtils"; import { useNotification } from "../hooks/useNotification"; import { Modal } from "../components/common/Modal"; @@ -330,18 +332,35 @@ const SettingsPage: React.FC = () => {
+
@@ -399,13 +418,6 @@ const SettingsPage: React.FC = () => { /> ))} - setSelectedAccentColor(e.target.value)} - />