mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: optimize filters sync (#4260)
* refactor: add bi-directional filters sync between filterStore and searchParams * fix: tag redirection from memos detail page, https://github.com/usememos/memos/issues/4232
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { NavigateOptions, useNavigate } from "react-router-dom";
|
||||
|
||||
const useNavigateTo = () => {
|
||||
const navigateTo = useNavigate();
|
||||
|
||||
const navigateToWithViewTransition = (to: string) => {
|
||||
const navigateToWithViewTransition = (to: string, options?: NavigateOptions) => {
|
||||
const document = window.document as any;
|
||||
if (!document.startViewTransition) {
|
||||
navigateTo(to);
|
||||
navigateTo(to, options);
|
||||
} else {
|
||||
document.startViewTransition(() => {
|
||||
navigateTo(to);
|
||||
navigateTo(to, options);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user