Browse Source

fix: dispatch mobile events only on mobile

Tienson Qin 3 months ago
parent
commit
5bd4b09258
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/frontend/handler/events.cljs

+ 2 - 1
src/main/frontend/handler/events.cljs

@@ -184,7 +184,8 @@
     (p/do!
      (state/pub-event! [:graph/sync-context])
     ;; re-render-root is async and delegated to rum, so we need to wait for main ui to refresh
-     (state/pub-event! [:mobile/post-init])
+     (when (util/mobile?)
+       (state/pub-event! [:mobile/post-init]))
      ;; FIXME: an ugly implementation for redirecting to page on new window is restored
      (repo-handler/graph-ready! repo)
      (if db-based?