mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 17:14:50 +00:00
Moderation: Add keybinds for link copying and setting project status (#6716)
Add keybinds for link copying and setting project status
This commit is contained in:
@@ -1207,6 +1207,29 @@ function handleKeybinds(event: KeyboardEvent) {
|
||||
tryWithhold: () => sendMessage('withheld'),
|
||||
tryEditMessage: goBackToStages,
|
||||
|
||||
tryCopyLink: async (permalink: boolean, relative: boolean, page: boolean) => {
|
||||
let url = ``
|
||||
if (relative) {
|
||||
url += `${globalThis.location.origin}`
|
||||
} else {
|
||||
url += `https://modrinth.com`
|
||||
}
|
||||
|
||||
if (permalink) {
|
||||
url += `/project/${projectV2.value.id}`
|
||||
} else {
|
||||
url += `/${projectV2.value.project_type}/${projectV2.value.slug}`
|
||||
}
|
||||
|
||||
if (page) {
|
||||
url += `/${globalThis.location.pathname.split('/').slice(3).join('/')}`
|
||||
}
|
||||
|
||||
await navigator.clipboard.writeText(url)
|
||||
},
|
||||
|
||||
tryCopyId: async () => await navigator.clipboard.writeText(projectV2.value.id),
|
||||
|
||||
tryToggleAction: (actionIndex: number) => {
|
||||
const action = visibleActions.value[actionIndex]
|
||||
if (action) {
|
||||
|
||||
Reference in New Issue
Block a user