fix (client): do not refresh the page on showAttachedNotes (closes #10969)

This commit is contained in:
naskya 2024-07-21 19:13:23 +09:00
parent 7239d897ac
commit 44483bb9ae
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -48,6 +48,7 @@ import { i18n } from "@/i18n";
import { me } from "@/me"; import { me } from "@/me";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
import type { MenuItem } from "@/types/menu"; import type { MenuItem } from "@/types/menu";
import { useRouter } from "@/router";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -67,6 +68,8 @@ const emit = defineEmits<{
(ev: "dragend"): void; (ev: "dragend"): void;
}>(); }>();
const router = useRouter();
const isDragging = ref(false); const isDragging = ref(false);
const title = computed( const title = computed(
@ -107,10 +110,11 @@ function getMenu(): MenuItem[] {
download: props.file.name, download: props.file.name,
}, },
{ {
type: "a",
href: `/my/drive/file/${props.file.id}/attached`,
text: i18n.ts.showAttachedNotes, text: i18n.ts.showAttachedNotes,
icon: `${icon("ph-paperclip")}`, icon: `${icon("ph-paperclip")}`,
action: () => {
router.push(`/my/drive/file/${props.file.id}/attached`);
},
}, },
null, null,
{ {