chore: generate
This commit is contained in:
@@ -821,7 +821,7 @@ export default function Page() {
|
|||||||
const sessionID = params.id
|
const sessionID = params.id
|
||||||
if (!sessionID) return
|
if (!sessionID) return
|
||||||
if (status()?.type !== "idle") {
|
if (status()?.type !== "idle") {
|
||||||
await sdk.client.session.abort({ sessionID }).catch(() => { })
|
await sdk.client.session.abort({ sessionID }).catch(() => {})
|
||||||
}
|
}
|
||||||
const revert = info()?.revert?.messageID
|
const revert = info()?.revert?.messageID
|
||||||
// Find the last user message that's not already reverted
|
// Find the last user message that's not already reverted
|
||||||
@@ -904,69 +904,69 @@ export default function Page() {
|
|||||||
},
|
},
|
||||||
...(sync.data.config.share !== "disabled"
|
...(sync.data.config.share !== "disabled"
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
id: "session.share",
|
id: "session.share",
|
||||||
title: language.t("command.session.share"),
|
title: language.t("command.session.share"),
|
||||||
description: language.t("command.session.share.description"),
|
description: language.t("command.session.share.description"),
|
||||||
category: language.t("command.category.session"),
|
category: language.t("command.category.session"),
|
||||||
slash: "share",
|
slash: "share",
|
||||||
disabled: !params.id || !!info()?.share?.url,
|
disabled: !params.id || !!info()?.share?.url,
|
||||||
onSelect: async () => {
|
onSelect: async () => {
|
||||||
if (!params.id) return
|
if (!params.id) return
|
||||||
await sdk.client.session
|
await sdk.client.session
|
||||||
.share({ sessionID: params.id })
|
.share({ sessionID: params.id })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
navigator.clipboard.writeText(res.data!.share!.url).catch(() =>
|
navigator.clipboard.writeText(res.data!.share!.url).catch(() =>
|
||||||
|
showToast({
|
||||||
|
title: language.t("toast.session.share.copyFailed.title"),
|
||||||
|
variant: "error",
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.then(() =>
|
||||||
showToast({
|
showToast({
|
||||||
title: language.t("toast.session.share.copyFailed.title"),
|
title: language.t("toast.session.share.success.title"),
|
||||||
|
description: language.t("toast.session.share.success.description"),
|
||||||
|
variant: "success",
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.catch(() =>
|
||||||
|
showToast({
|
||||||
|
title: language.t("toast.session.share.failed.title"),
|
||||||
|
description: language.t("toast.session.share.failed.description"),
|
||||||
variant: "error",
|
variant: "error",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
},
|
||||||
.then(() =>
|
|
||||||
showToast({
|
|
||||||
title: language.t("toast.session.share.success.title"),
|
|
||||||
description: language.t("toast.session.share.success.description"),
|
|
||||||
variant: "success",
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.catch(() =>
|
|
||||||
showToast({
|
|
||||||
title: language.t("toast.session.share.failed.title"),
|
|
||||||
description: language.t("toast.session.share.failed.description"),
|
|
||||||
variant: "error",
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
id: "session.unshare",
|
||||||
id: "session.unshare",
|
title: language.t("command.session.unshare"),
|
||||||
title: language.t("command.session.unshare"),
|
description: language.t("command.session.unshare.description"),
|
||||||
description: language.t("command.session.unshare.description"),
|
category: language.t("command.category.session"),
|
||||||
category: language.t("command.category.session"),
|
slash: "unshare",
|
||||||
slash: "unshare",
|
disabled: !params.id || !info()?.share?.url,
|
||||||
disabled: !params.id || !info()?.share?.url,
|
onSelect: async () => {
|
||||||
onSelect: async () => {
|
if (!params.id) return
|
||||||
if (!params.id) return
|
await sdk.client.session
|
||||||
await sdk.client.session
|
.unshare({ sessionID: params.id })
|
||||||
.unshare({ sessionID: params.id })
|
.then(() =>
|
||||||
.then(() =>
|
showToast({
|
||||||
showToast({
|
title: language.t("toast.session.unshare.success.title"),
|
||||||
title: language.t("toast.session.unshare.success.title"),
|
description: language.t("toast.session.unshare.success.description"),
|
||||||
description: language.t("toast.session.unshare.success.description"),
|
variant: "success",
|
||||||
variant: "success",
|
}),
|
||||||
}),
|
)
|
||||||
)
|
.catch(() =>
|
||||||
.catch(() =>
|
showToast({
|
||||||
showToast({
|
title: language.t("toast.session.unshare.failed.title"),
|
||||||
title: language.t("toast.session.unshare.failed.title"),
|
description: language.t("toast.session.unshare.failed.description"),
|
||||||
description: language.t("toast.session.unshare.failed.description"),
|
variant: "error",
|
||||||
variant: "error",
|
}),
|
||||||
}),
|
)
|
||||||
)
|
},
|
||||||
},
|
},
|
||||||
},
|
]
|
||||||
]
|
|
||||||
: []),
|
: []),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user