mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
33fa1700f8
commit
18415517bb
4 changed files with 26 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import {focusByRange} from "./selection";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
|
||||
export const openByMobile = (uri: string) => {
|
||||
if (!uri) {
|
||||
|
|
@ -13,7 +14,7 @@ export const openByMobile = (uri: string) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const readText = async () => {
|
||||
export const readText = async () => {
|
||||
if ("android" === window.siyuan.config.system.container && window.JSAndroid) {
|
||||
return window.JSAndroid.readClipboard();
|
||||
}
|
||||
|
|
@ -133,9 +134,15 @@ export const hotKey2Electron = (key: string) => {
|
|||
};
|
||||
|
||||
export const setLocalStorage = () => {
|
||||
|
||||
fetchPost("/api/system/getLocalStorage", undefined, (response) => {
|
||||
Object.keys(response.data).forEach(item => {
|
||||
window.localStorage.setItem(item, response.data[item]);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export const exportLocalStorage = () => {
|
||||
|
||||
export const exportLocalStorage = (cb: () => void) => {
|
||||
fetchPost("/api/system/setLocalStorage", {val: JSON.stringify(localStorage)}, (response) => {
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue