Skip to content

Commit 627bfce

Browse files
xyhp915tiensonqin
authored andcommitted
fix(sync): synced pictures not reload on mobile
1 parent b4b5224 commit 627bfce

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

deps/graph-parser/src/logseq/graph_parser/config.cljs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
(ns logseq.graph-parser.config
22
"App config that is shared between graph-parser and rest of app"
33
(:require [clojure.set :as set]
4-
[clojure.string :as string]))
4+
[clojure.string :as string]
5+
[goog.object :as gobj]))
56

67
(def app-name
78
"Copy of frontend.config/app-name. Too small to couple to main app"
89
"logseq")
910

1011
(defonce asset-protocol "assets://")
1112
(defonce capacitor-protocol "capacitor://")
12-
(defonce capacitor-protocol-with-prefix (str capacitor-protocol "localhost/_capacitor_file_"))
13+
(defonce capacitor-prefix "_capacitor_file_")
14+
(defonce capacitor-protocol-with-prefix (str capacitor-protocol "localhost/" capacitor-prefix))
15+
(defonce capacitor-x-protocol-with-prefix (str (gobj/getValueByKeys js/globalThis "location" "href") capacitor-prefix))
1316

1417
(defonce local-assets-dir "assets")
1518

@@ -22,14 +25,16 @@
2225
[s]
2326
(when (string? s)
2427
(or (string/starts-with? s asset-protocol)
25-
(string/starts-with? s capacitor-protocol))))
28+
(string/starts-with? s capacitor-protocol)
29+
(string/starts-with? s capacitor-x-protocol-with-prefix))))
2630

2731
(defn remove-asset-protocol
2832
[s]
2933
(if (local-protocol-asset? s)
3034
(-> s
3135
(string/replace-first asset-protocol "")
32-
(string/replace-first capacitor-protocol-with-prefix "file://"))
36+
(string/replace-first capacitor-protocol-with-prefix "file://")
37+
(string/replace-first capacitor-x-protocol-with-prefix "file://"))
3338
s))
3439

3540
(defonce default-draw-directory "draws")

0 commit comments

Comments
 (0)