Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: copy to clipboard error

Sai Deepeshdddd5e7ac009
diff --git a/studio/lib/helpers.ts b/studio/lib/helpers.ts
index d11dd083a6e..35d3398283d 100644
--- a/studio/lib/helpers.ts
+++ b/studio/lib/helpers.ts
@@ -162,10 +162,11 @@ export const copyToClipboard = (str: string | Promise<string>, callback = () =>
const focused = window.document.hasFocus()
if (focused) {
if (window.ClipboardItem) {
- const text = new ClipboardItem({
- 'text/plain': Promise.resolve(str).then((text) => new Blob([text], { type: 'text/plain' })),
- })
- window.navigator?.clipboard?.write([text]).then(callback)
+ Promise.resolve(str)
+ .then((text) => new Blob([text], { type: 'text/plain' }))
+ .then((blob) => new ClipboardItem({ 'text/plain': blob }))
+ .then((text) => window.navigator?.clipboard?.write([text]))
+ .then(callback)
return
}
@@ -178,6 +179,7 @@ export const copyToClipboard = (str: string | Promise<string>, callback = () =>
}
}
+
export async function passwordStrength(value: string) {
let message = ''
let warning = ''