Skip to content

Commit fc9532f

Browse files
committed
refactor(tables): reuse clipboard helper
1 parent 62968bf commit fc9532f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid

‎apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type React from 'react'
44
import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
5-
import { cn, toast, useToast } from '@sim/emcn'
5+
import { cn, toast, useToast, writeTextToClipboard } from '@sim/emcn'
66
import { Loader, TableX } from '@sim/emcn/icons'
77
import { createLogger } from '@sim/logger'
88
import type { TableCellSelection } from '@sim/realtime-protocol/table-presence'
@@ -1835,7 +1835,7 @@ export function TableGrid({
18351835
function handleCopyRowId() {
18361836
const rowId = contextMenu.row?.id
18371837
if (!rowId) return
1838-
void navigator.clipboard.writeText(rowId).catch((error) => {
1838+
void writeTextToClipboard(rowId).catch((error) => {
18391839
logger.error('Failed to copy row ID', { error })
18401840
toast.error('Failed to copy row ID')
18411841
})

0 commit comments

Comments
 (0)