Browse Source

enhance(mobile): add option for editing photo before embeding it

leizhe 4 years ago
parent
commit
d1b43ee719
2 changed files with 8 additions and 1 deletions
  1. 4 1
      src/main/frontend/mobile/camera.cljs
  2. 4 0
      templates/config.edn

+ 4 - 1
src/main/frontend/mobile/camera.cljs

@@ -11,7 +11,10 @@
 (defn- get-photo []
   (p/let [photo (.getPhoto Camera (clj->js
                                    {:quality 90
-                                    :allowEditing false
+                                    :allowEditing (get-in
+                                                   (state/get-config)
+                                                   [:mobile/photo :allow-editing?]
+                                                   true)
                                     :saveToGallery true
                                     :resultType (.-Uri CameraResultType)}))
           photo-buffer (.readFile Filesystem (clj->js {:path (.-path photo)}))

+ 4 - 0
templates/config.edn

@@ -182,4 +182,8 @@
  ;;  :enabled-in-all-blocks true ;display logbook in all blocks after timetracking
  ;;  :enabled-in-timestamped-blocks false ;don't display logbook at all
  ;; }
+
+ ;; Mobile photo uploading setup
+ ;; :mobile/photo
+ ;; {:allow-editing? true}
  }