fix(ios): empty repo-url on first-boot(logged)

pull/9831/head
Andelf 2023-07-10 16:10:27 +08:00
parent 10ec7d6c8f
commit 07b8b030ea
1 changed files with 13 additions and 10 deletions

View File

@ -142,14 +142,17 @@
[value nil nil])))
(defn get-graph-name-from-path
"Get `Dir/GraphName` style name for from repo-url"
"Get `Dir/GraphName` style name for from repo-url.
On iOS, repo-url might be nil"
[repo-url]
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts))))
(when (not-empty repo-url)
(let [path (config/get-local-dir repo-url)
path (if (path/is-file-url? path)
(path/url-to-path path)
path)
parts (->> (string/split path #"/")
(take-last 2))]
(if (not= (first parts) "0")
(util/string-join-path parts)
(last parts)))))