Explorar el Código

fix: can't paste on iOS

fix #6898
fix #7122
fix #6513
fix #6898
Tienson Qin hace 3 años
padre
commit
ed83d2bd0f
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/main/frontend/utils.js

+ 2 - 2
src/main/frontend/utils.js

@@ -1,6 +1,7 @@
 import path from 'path/path.js'
 
 // TODO split the capacitor abilities to a separate file for capacitor APIs
+import { Capacitor } from '@capacitor/core'
 import { StatusBar, Style } from '@capacitor/status-bar'
 import { Clipboard as CapacitorClipboard } from '@capacitor/clipboard'
 
@@ -244,9 +245,8 @@ export const getClipText = (cb, errorHandler) => {
   })
 }
 
-// TODO split the capacitor clipboard to a separate file for capacitor APIs
 export const writeClipboard = ({text, html}) => {
-    if (typeof navigator.permissions == "undefined") {
+    if (Capacitor.isNativePlatform()) {
         CapacitorClipboard.write({ string: text });
         return
     }