diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 9ed024b667..94482261a5 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -4,7 +4,7 @@ "bundledWebRuntime": false, "webDir": "public", "server": { - "url": "http://192.168.147.189:3001", + "url": "http://192.168.1.59:3001", "cleartext": true } } diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index 1a5157e27c..5b0e8aa70f 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -235,7 +235,7 @@ (commands/handle-step [:editor/search-page]))}) (when-let [input (gdom/getElement parent-id)] (.focus input)))} - "[[]]"] + "[["] [:button.bottom-action.text-sm {:on-click #(do (commands/simple-insert! @@ -246,7 +246,7 @@ (commands/handle-step [:editor/search-block]))}) (when-let [input (gdom/getElement parent-id)] (.focus input)))} - "(())"] + "(("] [:button.bottom-action.text-sm {:on-click #(do (commands/simple-insert! parent-id "/" {}) diff --git a/src/main/frontend/components/editor.css b/src/main/frontend/components/editor.css index 1efda4fd63..ea44946507 100644 --- a/src/main/frontend/components/editor.css +++ b/src/main/frontend/components/editor.css @@ -12,7 +12,7 @@ transition: top 0.3s; > button { - padding: 12px; + padding: 10px; } } diff --git a/src/main/frontend/fs.cljs b/src/main/frontend/fs.cljs index e19d7b39ad..a91650713b 100644 --- a/src/main/frontend/fs.cljs +++ b/src/main/frontend/fs.cljs @@ -114,17 +114,21 @@ [dir path] (protocol/stat (get-fs dir) dir path)) +(defn- get-record + [] + (cond + (util/electron?) + node-record + + (mobile-util/is-native-platform?) + mobile-record + + :else + nfs-record)) + (defn open-dir [ok-handler] - (let [record (cond - (util/electron?) - node-record - - (mobile-util/is-native-platform?) - mobile-record - - :else - nfs-record)] + (let [record (get-record)] (-> (p/let [result (protocol/open-dir record ok-handler)] (if (or (util/electron?) @@ -137,9 +141,10 @@ (defn get-files [path-or-handle ok-handler] - (let [record (if (util/electron?) node-record nfs-record)] + (let [record (get-record)] (p/let [result (protocol/get-files record path-or-handle ok-handler)] - (if (util/electron?) + (if (or (util/electron?) + (mobile-util/is-native-platform?)) (let [result (bean/->clj result)] (rest result)) result)))) diff --git a/src/main/frontend/fs/capacitor_fs.cljs b/src/main/frontend/fs/capacitor_fs.cljs index ce8102e321..df36cbc2b2 100644 --- a/src/main/frontend/fs/capacitor_fs.cljs +++ b/src/main/frontend/fs/capacitor_fs.cljs @@ -145,8 +145,8 @@ (js/console.log path) (js/console.log files) (into [] (concat [{:path path}] files))))) - (get-files [this path-or-handle ok-handler] - nil) + (get-files [this path-or-handle _ok-handler] + (readdir path-or-handle)) (watch-dir! [this dir] nil)) diff --git a/src/main/frontend/handler.cljs b/src/main/frontend/handler.cljs index 1196896c7f..39e10ce8ff 100644 --- a/src/main/frontend/handler.cljs +++ b/src/main/frontend/handler.cljs @@ -235,4 +235,4 @@ (p/let [_ (el/persist-dbs!) _ (reset! triggered? true) _ (ipc/invoke "set-quit-dirty-state" false)] - (ipc/ipc :quitAndInstall))) \ No newline at end of file + (ipc/ipc :quitAndInstall))) diff --git a/src/main/frontend/handler/web/nfs.cljs b/src/main/frontend/handler/web/nfs.cljs index ebbd704f32..89f8e7e932 100644 --- a/src/main/frontend/handler/web/nfs.cljs +++ b/src/main/frontend/handler/web/nfs.cljs @@ -279,8 +279,10 @@ (when re-index? (state/set-graph-syncing? true)) (-> - (p/let [handle (idb/get-item handle-path)] - (when (or handle electron?) ; electron doesn't store the file handle + (p/let [handle (-> (idb/get-item handle-path) + (p/catch (fn [_error] + nil)))] + (when (or handle electron? mobile-native?) ; electron doesn't store the file handle (p/let [_ (when handle (nfs/verify-permission repo handle true)) files-result (fs/get-files (if nfs? handle (config/get-local-dir repo))