better copying

This commit is contained in:
2026-02-06 16:51:00 -05:00
parent 70f50eec2a
commit db74e20571

View File

@@ -20,7 +20,8 @@ import { useMultimediaKeys } from "@/hooks/useMultimediaKeys";
import { FeedVisibility } from "@/types/feed"; import { FeedVisibility } from "@/types/feed";
import { useAppKeyboard } from "@/hooks/useAppKeyboard"; import { useAppKeyboard } from "@/hooks/useAppKeyboard";
import { Clipboard } from "@/utils/clipboard"; import { Clipboard } from "@/utils/clipboard";
import { emit } from "@/utils/event-bus"; import { useToast } from "@/ui/toast";
import { useRenderer } from "@opentui/solid";
import type { TabId } from "@/components/Tab"; import type { TabId } from "@/components/Tab";
import type { AuthScreen } from "@/types/auth"; import type { AuthScreen } from "@/types/auth";
import type { Episode } from "@/types/episode"; import type { Episode } from "@/types/episode";
@@ -35,6 +36,8 @@ export function App() {
const feedStore = useFeedStore(); const feedStore = useFeedStore();
const appStore = useAppStore(); const appStore = useAppStore();
const audio = useAudio(); const audio = useAudio();
const toast = useToast();
const renderer = useRenderer();
// Global multimedia key handling — active when Player tab is NOT // Global multimedia key handling — active when Player tab is NOT
// focused (Player.tsx handles its own keys when focused). // focused (Player.tsx handles its own keys when focused).
@@ -105,13 +108,12 @@ export function App() {
Clipboard.copy(text) Clipboard.copy(text)
.then(() => { .then(() => {
emit("toast.show", { toast.show({ message: "Copied to Clipboard!", variant: "info" });
message: "Copied to clipboard",
variant: "info",
duration: 1500,
});
}) })
.catch(() => {}); .catch(toast.error)
.finally(() => {
renderer.clearSelection();
});
}); });
const getPanels = createMemo(() => { const getPanels = createMemo(() => {