Browse Source

fix(mobile): close left sidebar when create a new page

Tienson Qin 4 years ago
parent
commit
0990b3a988

+ 3 - 0
android/app/src/main/assets/capacitor.config.json

@@ -13,6 +13,9 @@
 			"backgroundColor": "#002b36"
 		}
 	},
+	"ios": {
+		"scheme": "Logseq"
+	},
 	"server": {
 		"url": "http://192.168.1.59:3001",
 		"cleartext": true

+ 4 - 1
src/main/frontend/components/sidebar.cljs

@@ -281,7 +281,10 @@
           [:nav.px-2.space-y-1 {:aria-label "Sidebar"
                                 :class "new-page"}
            (when-not config/publishing?
-             [:a.item.group.flex.items-center.px-2.py-2.text-sm.font-medium.rounded-md {:on-click #(state/pub-event! [:go/search])}
+             [:a.item.group.flex.items-center.px-2.py-2.text-sm.font-medium.rounded-md
+              {:on-click (fn []
+                           (state/toggle-left-sidebar!)
+                           (state/pub-event! [:go/search]))}
               (ui/icon "circle-plus mr-3" {:style {:font-size 20}})
               [:span.flex-1 "New page"]])]]]))))