mirror of
https://github.com/supabase/supabase.git
synced 2026-09-09 19:42:46 +08:00
* chore: remove react-tracked part 1 * move out table specific state to own store * chore: remove react-tracked part 2 * remove unused type * ensure table is properly updated on changes * remove all filters save in local storage * Tiny fixes * fix sort / filters applying issue + feedback * fix entity links * remove unnecessary style --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
17 lines
449 B
TypeScript
17 lines
449 B
TypeScript
export function formatClipboardValue(value: any) {
|
|
if (!value) return ''
|
|
if (typeof value == 'object' || Array.isArray(value)) {
|
|
return JSON.stringify(value)
|
|
}
|
|
return value
|
|
}
|
|
|
|
export const copyToClipboard = (str: string, callback = () => {}) => {
|
|
const focused = window.document.hasFocus()
|
|
if (focused) {
|
|
window.navigator?.clipboard?.writeText(str).then(callback)
|
|
} else {
|
|
console.warn('Unable to copy to clipboard')
|
|
}
|
|
}
|