|
|
@@ -138,6 +138,28 @@
|
|
|
"new native filesystem API"]
|
|
|
[:span ", please use any Chromium 86+ based browser like Chrome, Vivaldi, Edge, etc. Notice that the API doesn't support mobile browsers at the moment."]]))]]]))]))
|
|
|
|
|
|
+(rum/defc android-permission-alert
|
|
|
+ []
|
|
|
+ (when (mobile-util/native-android?)
|
|
|
+ (rum/with-context [[t] i18n/*tongue-context*]
|
|
|
+ [:div.flex.flex-col
|
|
|
+ [:h1.title "Storage access permission"]
|
|
|
+ [:div.text-sm
|
|
|
+ [:div
|
|
|
+ [:p "Logseq needs the permission to access your device storage. Read "
|
|
|
+ [:a {:href "https://developer.android.com/about/versions/11/privacy/storage#all-files-access"
|
|
|
+ :target "_blank"}
|
|
|
+ "more"]
|
|
|
+ "."]
|
|
|
+ [:div
|
|
|
+ (ui/button "Grant Permission"
|
|
|
+ :on-click #(page-handler/ls-dir-files! shortcut/refresh!))]
|
|
|
+ [:p.mb-1 "Note:"]
|
|
|
+ [:ol
|
|
|
+ [:li "We will never access files outside of your graph folders you choose."]
|
|
|
+ [:li "If you have granted the permission, you don't need to do it again."]]]
|
|
|
+ [:hr]]])))
|
|
|
+
|
|
|
(rum/defcs add-graph <
|
|
|
[state & {:keys [graph-types]
|
|
|
:or {graph-types [:local :github]}
|
|
|
@@ -151,8 +173,10 @@
|
|
|
"add-github-repo"))
|
|
|
|
|
|
:local
|
|
|
- (rum/with-key (add-local-directory)
|
|
|
- "add-local-directory")
|
|
|
+ [(rum/with-key (android-permission-alert)
|
|
|
+ "andoird-permission-alert")
|
|
|
+ (rum/with-key (add-local-directory)
|
|
|
+ "add-local-directory")]
|
|
|
|
|
|
nil))
|
|
|
available-graph (->> (set graph-types)
|