fix: can't paste on iOS

fix #6898
fix #7122
fix #6513
fix #6898
This commit is contained in:
Tienson Qin
2022-11-08 21:51:26 +08:00
parent 2cc3f46702
commit ed83d2bd0f

View File

@@ -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
}