diff --git a/.changeset/sharp-camels-collect.md b/.changeset/sharp-camels-collect.md new file mode 100644 index 00000000..0ed84fa2 --- /dev/null +++ b/.changeset/sharp-camels-collect.md @@ -0,0 +1,5 @@ +--- +'pastebar-app-ui': patch +--- + +Fix: Autogenerate link settings not working in Quick Paste Window diff --git a/packages/pastebar-app-ui/src/pages/main/ClipboardHistoryQuickPastePage.tsx b/packages/pastebar-app-ui/src/pages/main/ClipboardHistoryQuickPastePage.tsx index 388182c4..e91ad42e 100644 --- a/packages/pastebar-app-ui/src/pages/main/ClipboardHistoryQuickPastePage.tsx +++ b/packages/pastebar-app-ui/src/pages/main/ClipboardHistoryQuickPastePage.tsx @@ -3,7 +3,7 @@ import { UniqueIdentifier } from '@dnd-kit/core' import { listen } from '@tauri-apps/api/event' import { invoke } from '@tauri-apps/api/tauri' import { appWindow } from '@tauri-apps/api/window' -import { isKeyAltPressed, isKeyCtrlPressed } from '~/store' +import { isKeyAltPressed, isKeyCtrlPressed, settingsStoreAtom } from '~/store' import { useAtomValue } from 'jotai' import { throttle } from 'lodash-es' import { ArrowDownFromLine, ArrowUpToLine, Search } from 'lucide-react' @@ -102,6 +102,9 @@ export default function ClipboardHistoryQuickPastePage() { const isShowSearch = useSignal(false) const { movePinnedClipboardHistoryUpDown } = useMovePinnedClipboardHistoryUpDown() + const { isAutoPreviewLinkCardsEnabled, isAutoGenerateLinkCardsEnabled } = + useAtomValue(settingsStoreAtom) + const [historyFilters, setHistoryFilters] = useState([]) const [codeFilters, setCodeFilters] = useState([]) const [appFilters, setAppFilters] = useState([]) @@ -651,6 +654,10 @@ export default function ClipboardHistoryQuickPastePage() { addToClipboardHistoryIdsURLErrors={ addToClipboardHistoryIdsURLErrors } + isLinkCardPreviewEnabled={isAutoPreviewLinkCardsEnabled} + isAutoGenerateLinkCardsEnabled={ + isAutoGenerateLinkCardsEnabled + } addToGenerateLinkMetaDataInProgress={ addToGenerateLinkMetaDataInProgress } @@ -834,6 +841,10 @@ export default function ClipboardHistoryQuickPastePage() { addToGenerateLinkMetaDataInProgress={ addToGenerateLinkMetaDataInProgress } + isLinkCardPreviewEnabled={isAutoPreviewLinkCardsEnabled} + isAutoGenerateLinkCardsEnabled={ + isAutoGenerateLinkCardsEnabled + } isScrolling={isScrolling} removeToGenerateLinkMetaDataInProgress={ removeToGenerateLinkMetaDataInProgress diff --git a/src-tauri/src/commands/link_metadata_commands.rs b/src-tauri/src/commands/link_metadata_commands.rs index ea2d1a8b..e181845c 100644 --- a/src-tauri/src/commands/link_metadata_commands.rs +++ b/src-tauri/src/commands/link_metadata_commands.rs @@ -10,7 +10,7 @@ use crate::services::link_metadata_service::{ delete_link_metadata_by_item_id, insert_or_update_link_metadata, AudioInfo, }; -use crate::services::utils::{decode_html_entities, ensure_url_prefix}; +use crate::services::utils::{debug_output, decode_html_entities, ensure_url_prefix}; use linkify::{LinkFinder, LinkKind}; use nanoid::nanoid; @@ -248,6 +248,9 @@ pub async fn fetch_link_metadata( item_id: Option, is_preview_only: Option, ) -> Result { + debug_output(|| { + println!("Fetching metadata for URL: {}", url); + }); if url.is_empty() { return Err("URL is empty".to_string()); }