Skip to content

Commit

Permalink
fix: fix setting shortut
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglun committed Nov 2, 2023
1 parent 9e8c294 commit c364b44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { appWindow } from "@tauri-apps/api/window";
import { Outlet } from "react-router-dom";
import { Outlet, useNavigate } from "react-router-dom";
import { ChannelList } from "./components/Subscribes";
import { useBearStore } from "@/stores";
import * as dataAgent from "./helpers/dataAgent";
Expand All @@ -27,17 +27,21 @@ function App() {
goPreviousArticle: state.goPreviousArticle,
goNextArticle: state.goNextArticle,
getUserConfig: state.getUserConfig,
setLastViewRouteBeforeSetting: state.setLastViewRouteBeforeSetting,
}));

const navigate = useNavigate();

useEffect(() => {
listen("go-to-settings", () => {
console.log(
"%c Line:34 🍒 go-to-setting",
"color:#fca650",
"go-to-setting"
);
store.setLastViewRouteBeforeSetting(Object.assign({ ...location }));
navigate(RouteConfig.SETTINGS_GENERAL);

window.location.href = RouteConfig.SETTINGS_GENERAL;
});
}, []);

Expand Down

0 comments on commit c364b44

Please sign in to comment.