diff --git a/src/hooks/useLink.ts b/src/hooks/useLink.ts index 7c33dbd3a..17ed24e5e 100644 --- a/src/hooks/useLink.ts +++ b/src/hooks/useLink.ts @@ -67,7 +67,16 @@ export const getLinkByDirAndObj = ( export const useLink = () => { const { pathname, isShare } = useRouter() const getLinkByObj = (obj: Obj, type?: URLType, encodeAll?: boolean) => { - const dir = objStore.state !== State.File ? pathname() : pathDir(pathname()) + let dir: string + if (objStore.state === State.File) { + dir = pathDir(pathname()) + if (isShare() && dir === "/@s") { + dir = pathname() + obj = { ...obj, name: "" } + } + } else { + dir = pathname() + } return getLinkByDirAndObj(dir, obj, type, isShare(), encodeAll) } const rawLink = (obj: Obj, encodeAll?: boolean) => { diff --git a/src/pages/home/folder/context-menu.tsx b/src/pages/home/folder/context-menu.tsx index c5e0c2fe3..9aafd5457 100644 --- a/src/pages/home/folder/context-menu.tsx +++ b/src/pages/home/folder/context-menu.tsx @@ -65,7 +65,7 @@ export const ContextMenu = () => { )}