🎨 移动端复制后长按块粘贴无效 Fix https://github.com/siyuan-note/insider/issues/1091

This commit is contained in:
Liang Ding 2022-10-07 11:00:52 +08:00
parent 34e4697878
commit 21b76c1a72
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 13 additions and 4 deletions

View file

@ -13,6 +13,13 @@ export const openByMobile = (uri: string) => {
}
};
export const readText = async () => {
if ("android" === window.siyuan.config.system.container && window.JSAndroid) {
return window.JSAndroid.readClipboard();
}
return navigator.clipboard.readText();
}
export const writeText = async (text: string) => {
let range: Range;
if (getSelection().rangeCount > 0) {