diff --git a/src/App.tsx b/src/App.tsx
index 1e765b1..474a468 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -5,9 +5,11 @@ import { Auth } from './modules/layouts/Auth';
// import { basename } from './modules/basename';
import 'github-markdown-css/github-markdown.css';
export const App = () => {
+ const url = new URL(location.href);
+ const id = url.searchParams.get('id') || undefined;
return (
<>
-
+
>
);
diff --git a/src/modules/tiptap/editor.ts b/src/modules/tiptap/editor.ts
index 166aa7b..8d47b2f 100644
--- a/src/modules/tiptap/editor.ts
+++ b/src/modules/tiptap/editor.ts
@@ -49,7 +49,7 @@ export class TextEditor {
StarterKit, // 使用 StarterKit 包含基础功能
Highlight,
Placeholder.configure({
- placeholder: 'Type ! to see commands (e.g., !today, !list !test )...',
+ placeholder: 'Type @ to see commands (e.g., @today, @list @test )...',
}),
Typography,
Markdown,
diff --git a/src/modules/tiptap/extensions/suggestions/commands.ts b/src/modules/tiptap/extensions/suggestions/commands.ts
index eaf9537..f7bada2 100644
--- a/src/modules/tiptap/extensions/suggestions/commands.ts
+++ b/src/modules/tiptap/extensions/suggestions/commands.ts
@@ -16,7 +16,7 @@ export const Commands = Extension.create({
addOptions() {
return {
suggestion: {
- char: '!',
+ char: '@',
command: ({ editor, range, props }: any) => {
editor
.chain()
diff --git a/src/pages/wall/index.tsx b/src/pages/wall/index.tsx
index bdba154..46a5802 100644
--- a/src/pages/wall/index.tsx
+++ b/src/pages/wall/index.tsx
@@ -33,6 +33,8 @@ import { ContextMenu } from './modules/ContextMenu';
import { useSelect } from './hooks/use-select';
import clsx from 'clsx';
import { AppendDemo, DemoLogin } from '../demo-login';
+import { List } from './pages/List';
+
type NodeData = {
id: string;
position: XYPosition;
@@ -221,6 +223,9 @@ export const Flow = ({ id }: { checkLogin?: boolean; id?: string }) => {
if (!token) {
return ;
}
+ if (!id) {
+ return
;
+ }
const wallStore = useWallStore(
useShallow((state) => {
return {
@@ -232,7 +237,9 @@ export const Flow = ({ id }: { checkLogin?: boolean; id?: string }) => {
);
useEffect(() => {
- wallStore.init(id);
+ if (id) {
+ wallStore.init(id);
+ }
}, [id]);
if (!wallStore.loaded) {
diff --git a/src/pages/wall/pages/List.tsx b/src/pages/wall/pages/List.tsx
index f49d089..e6f610d 100644
--- a/src/pages/wall/pages/List.tsx
+++ b/src/pages/wall/pages/List.tsx
@@ -3,9 +3,7 @@ import { useWallStore } from '../store/wall';
import { useUserWallStore } from '../store/user-wall';
import { useShallow } from 'zustand/react/shallow';
import { formatDate, formatRelativeDate } from '../../../modules/dayjs';
-import { useNavigate } from 'react-router-dom';
export const List = () => {
- const navigate = useNavigate();
const wallStore = useUserWallStore(
useShallow((state) => {
return {
@@ -20,6 +18,9 @@ export const List = () => {
const init = () => {
wallStore.queryWallList();
};
+ const navigate = (path: string) => {
+ window.location.href = path;
+ };
return (
{
key={wall.id}
className='p-4 border border-gray-200 w-80 rounded-md'
onClick={() => {
- navigate(`/edit/${wall.id}`);
+ const url = new URL(location.href);
+ url.searchParams.set('id', wall.id!);
+ navigate(url.toString());
}}>