chore: remove redundant comments in ClipboardHistory components for cleaner code readability
This commit is contained in:
parent
618ba3ae02
commit
9ba408d45e
@ -258,7 +258,6 @@ export function ClipboardHistoryQuickPasteRowComponent({
|
|||||||
const isNowItem = index === 0 && clipboard.updatedAt > Date.now() - MINUTE_IN_MS
|
const isNowItem = index === 0 && clipboard.updatedAt > Date.now() - MINUTE_IN_MS
|
||||||
const isMp3 = clipboard?.isLink && clipboard?.value?.endsWith('.mp3')
|
const isMp3 = clipboard?.isLink && clipboard?.value?.endsWith('.mp3')
|
||||||
|
|
||||||
// Recalculate preview with custom line limit if provided
|
|
||||||
const { valuePreview, valueMorePreviewLines, valueMorePreviewChars } = useMemo(() => {
|
const { valuePreview, valueMorePreviewLines, valueMorePreviewChars } = useMemo(() => {
|
||||||
if (historyPreviewLineLimit && historyPreviewLineLimit > 0 && clipboard?.value) {
|
if (historyPreviewLineLimit && historyPreviewLineLimit > 0 && clipboard?.value) {
|
||||||
const result = getValuePreview(
|
const result = getValuePreview(
|
||||||
@ -268,14 +267,13 @@ export function ClipboardHistoryQuickPasteRowComponent({
|
|||||||
historyPreviewLineLimit,
|
historyPreviewLineLimit,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
// console.log('result', result)
|
|
||||||
return {
|
return {
|
||||||
valuePreview: result.valuePreview,
|
valuePreview: result.valuePreview,
|
||||||
valueMorePreviewLines: result.morePreviewLines,
|
valueMorePreviewLines: result.morePreviewLines,
|
||||||
valueMorePreviewChars: result.morePreviewChars,
|
valueMorePreviewChars: result.morePreviewChars,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Use default preview from backend
|
|
||||||
return {
|
return {
|
||||||
valuePreview: clipboard?.valuePreview || '',
|
valuePreview: clipboard?.valuePreview || '',
|
||||||
valueMorePreviewLines: clipboard?.valueMorePreviewLines || null,
|
valueMorePreviewLines: clipboard?.valueMorePreviewLines || null,
|
||||||
|
@ -289,7 +289,6 @@ export function ClipboardHistoryRowComponent({
|
|||||||
const isNowItem = index === 0 && clipboard.updatedAt > Date.now() - MINUTE_IN_MS
|
const isNowItem = index === 0 && clipboard.updatedAt > Date.now() - MINUTE_IN_MS
|
||||||
const isMp3 = clipboard?.isLink && clipboard?.value?.endsWith('.mp3')
|
const isMp3 = clipboard?.isLink && clipboard?.value?.endsWith('.mp3')
|
||||||
|
|
||||||
// Recalculate preview with custom line limit if provided
|
|
||||||
const { valuePreview, valueMorePreviewLines, valueMorePreviewChars } = useMemo(() => {
|
const { valuePreview, valueMorePreviewLines, valueMorePreviewChars } = useMemo(() => {
|
||||||
if (historyPreviewLineLimit && historyPreviewLineLimit > 0 && clipboard?.value) {
|
if (historyPreviewLineLimit && historyPreviewLineLimit > 0 && clipboard?.value) {
|
||||||
const result = getValuePreview(
|
const result = getValuePreview(
|
||||||
@ -305,7 +304,6 @@ export function ClipboardHistoryRowComponent({
|
|||||||
valueMorePreviewChars: result.morePreviewChars,
|
valueMorePreviewChars: result.morePreviewChars,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Use default preview from backend
|
|
||||||
return {
|
return {
|
||||||
valuePreview: clipboard?.valuePreview || '',
|
valuePreview: clipboard?.valuePreview || '',
|
||||||
valueMorePreviewLines: clipboard?.valueMorePreviewLines || null,
|
valueMorePreviewLines: clipboard?.valueMorePreviewLines || null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user