use copyToClipboard util

This commit is contained in:
SrGooglo 2022-12-09 09:17:56 +00:00
parent 91fe890c61
commit 7b56bd04f1
3 changed files with 11 additions and 11 deletions

View File

@ -1,14 +1,5 @@
import download from "utils/download"
function copyToClipboard(text) {
if (!navigator.clipboard?.writeText) {
control.close()
return app.message.error("Clipboard API not supported")
}
navigator.clipboard.writeText(text)
app.message.success("Copied to clipboard")
}
import { copyToClipboard } from "utils"
export default {
"ignore": () => {

View File

@ -0,0 +1,8 @@
export default (text) => {
if (!navigator.clipboard?.writeText) {
return app.message.error("Clipboard API not supported")
}
navigator.clipboard.writeText(text)
app.message.success("Copied to clipboard")
}

View File

@ -5,4 +5,5 @@ export { default as getBase64 } from "./getBase64"
export { default as Haptics } from "./haptics"
export { default as processString } from "./processString"
export { default as deleteInternalStorage } from "./deleteInternalStorage"
export { default as handleOpenDevTools } from "./handleOpenDevTools"
export { default as handleOpenDevTools } from "./handleOpenDevTools"
export { default as copyToClipboard } from "./copyToClipboard"