Tienson Qin 7 месяцев назад
Родитель
Сommit
f79fafe7fc
1 измененных файлов с 4 добавлено и 5 удалено
  1. 4 5
      src/main/capacitor/components/popup.cljs

+ 4 - 5
src/main/capacitor/components/popup.cljs

@@ -13,10 +13,10 @@
                    vh js/window.innerHeight
                    [th bh] [y (- vh (+ y height) 300)]]
                (if (> bh 200) "bottom"
-                 (if (> (- th bh) 100)
-                   "top" "bottom")))]
+                   (if (> (- th bh) 100)
+                     "top" "bottom")))]
     (-> (assoc opts :auto-side? false)
-      (assoc-in [:content-props :side] side))))
+        (assoc-in [:content-props :side] side))))
 
 (defn popup-show!
   [event content-fn {:keys [id dropdown-menu?] :as opts}]
@@ -40,8 +40,7 @@
 
 (defn popup-hide!
   [& args]
-  (if @*last-popup-modal?
-    (state/set-popup! nil)
+  (when-not  @*last-popup-modal?
     (apply shui-popup/hide! args)))
 
 (set! shui/popup-show! popup-show!)