mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-26 11:38:59 +03:00
bump copy-to-clipboard to 4.0.2 (#24353)
This commit is contained in:
@@ -92,10 +92,12 @@ function PagePanel({ failure }: PanelProps) {
|
||||
|
||||
const stale = isStaleAsset(failure);
|
||||
|
||||
const onCopy = () => {
|
||||
// copy() falls back to a prompt and returns false when the clipboard is
|
||||
const onCopy = async () => {
|
||||
// copy() falls back to a prompt and resolves false when the clipboard is
|
||||
// refused, so a success toast has to wait on the result.
|
||||
const copied = copy(crashReport(failure, stats?.service.version));
|
||||
const copied = await copy(crashReport(failure, stats?.service.version), {
|
||||
fallbackToPrompt: true,
|
||||
});
|
||||
|
||||
if (copied) {
|
||||
toast.success(t("button.copiedToClipboard"), { position: "top-center" });
|
||||
|
||||
@@ -71,10 +71,10 @@ export function MessageBubble({
|
||||
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopy = useCallback(() => {
|
||||
const handleCopy = useCallback(async () => {
|
||||
const text = content?.trim() || "";
|
||||
if (!text) return;
|
||||
if (copy(text)) {
|
||||
if (await copy(text)) {
|
||||
setCopied(true);
|
||||
toast.success(t("button.copiedToClipboard", { ns: "common" }));
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
|
||||
@@ -362,10 +362,10 @@ function Logs() {
|
||||
});
|
||||
}, [isLoading, logState]);
|
||||
|
||||
const handleCopyLogs = useCallback(() => {
|
||||
const handleCopyLogs = useCallback(async () => {
|
||||
if (!logState.entries.length) return;
|
||||
|
||||
if (copy(logState.entries.map((entry) => entry.text).join("\n"))) {
|
||||
if (await copy(logState.entries.map((entry) => entry.text).join("\n"))) {
|
||||
toast.success(t("logs.copy.success"));
|
||||
} else {
|
||||
toast.error(t("logs.copy.error"));
|
||||
|
||||
Reference in New Issue
Block a user