fix: disable some conflicting whiteboard shortcuts

This commit is contained in:
Peng Xiao
2022-08-04 10:17:11 +08:00
parent 7eac75226d
commit 817d844758
3 changed files with 13 additions and 3 deletions

View File

@@ -41,6 +41,13 @@
[]
(when (get-tldr-app) js/tln.api))
(defn tldraw-idle?
"return true when tldraw is active and idle. nil when tldraw is
not active."
[]
(when-let [^js app (get-tldr-app)]
(.. app -selectedTool (isIn "idle"))))
(defn create-page!
[page-title]
(when-let [app (get-tldr-app)]
@@ -150,7 +157,7 @@
:compact true
:pageId (str block-id)
:point point
:size [600, 0]
:size [400, 0]
:type "logseq-portal"})
(defn add-new-block-shape!

View File

@@ -1,7 +1,8 @@
(ns frontend.modules.shortcut.before
(:require [frontend.state :as state]
[frontend.util :as util]
[frontend.mobile.util :as mobile-util]))
[frontend.mobile.util :as mobile-util]
[frontend.handler.whiteboard :as whiteboard]))
;; before function
(defn prevent-default-behavior
@@ -33,5 +34,6 @@
[f]
(fn [e]
(when (or (contains? #{:srs} (state/get-modal-id))
(not (state/block-component-editing?)))
(not (state/block-component-editing?))
(not (whiteboard/tldraw-idle?)))
(f e))))