Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/hooks/useLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/folder/context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const ContextMenu = () => {
)}
</For>
<Item
hidden={!userCan("share")}
hidden={!userCan("share") || isShare()}
onClick={() => {
bus.emit("tool", "share")
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/toolbar/Center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const Center = () => {
}}
</For>
</Show>
<Show when={userCan("share")}>
<Show when={userCan("share") && !isShare()}>
<CenterIcon
name="share"
onClick={() => {
Expand Down