Просмотр исходного кода

fix: can't paste on iOS

fix #6898
fix #7122
fix #6513
fix #6898
Tienson Qin 3 лет назад
Родитель
Сommit
ed83d2bd0f
1 измененных файлов с 2 добавлено и 2 удалено
  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
     }