mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 14:14:55 +00:00
fix: publishing failing to load on undefined LSPluginCore
Plugins shouldn't be on for publishing. Moved PUBLISHING to common-config as it is now relied on by frontend.util. Also removes needless state/publishing? and its wonky initialization
This commit is contained in:
2
deps/common/src/logseq/common/config.cljs
vendored
2
deps/common/src/logseq/common/config.cljs
vendored
@@ -3,6 +3,8 @@
|
||||
(:require [clojure.string :as string]
|
||||
[goog.object :as gobj]))
|
||||
|
||||
(goog-define PUBLISHING false)
|
||||
|
||||
(defn hidden?
|
||||
[path patterns]
|
||||
(let [path (if (and (string? path)
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
:output-dir "./static/js/publishing"
|
||||
:asset-path "static/js"
|
||||
:closure-defines {frontend.config/PUBLISHING true
|
||||
:closure-defines {logseq.common.config/PUBLISHING true
|
||||
goog.debug.LOGGING_ENABLED true}
|
||||
:compiler-options {:infer-externs :auto
|
||||
:output-feature-set :es-next
|
||||
|
||||
@@ -17,14 +17,11 @@
|
||||
(defonce dev-release? DEV-RELEASE)
|
||||
(defonce dev? ^boolean (or dev-release? goog.DEBUG))
|
||||
|
||||
(goog-define PUBLISHING false)
|
||||
(defonce publishing? PUBLISHING)
|
||||
(defonce publishing? common-config/PUBLISHING)
|
||||
|
||||
(goog-define REVISION "unknown")
|
||||
(defonce revision REVISION)
|
||||
|
||||
(reset! state/publishing? publishing?)
|
||||
|
||||
(def ENABLE-FILE-SYNC-PRODUCTION false)
|
||||
|
||||
;; this is a feature flag to enable the account tab
|
||||
|
||||
@@ -472,15 +472,13 @@ should be done through this fn in order to get global config and config defaults
|
||||
(get-global-config)
|
||||
(get-graph-config repo-url))))
|
||||
|
||||
(defonce publishing? (atom nil))
|
||||
|
||||
(defn publishing-enable-editing?
|
||||
[]
|
||||
(and @publishing? (:publishing/enable-editing? (get-config))))
|
||||
(and common-config/PUBLISHING (:publishing/enable-editing? (get-config))))
|
||||
|
||||
(defn enable-editing?
|
||||
[]
|
||||
(or (not @publishing?) (:publishing/enable-editing? (get-config))))
|
||||
(or (not common-config/PUBLISHING) (:publishing/enable-editing? (get-config))))
|
||||
|
||||
(defonce built-in-macros
|
||||
{"img" "[:img.$4 {:src \"$1\" :style {:width $2 :height $3}}]"})
|
||||
@@ -1950,7 +1948,7 @@ Similar to re-frame subscriptions"
|
||||
(when (and edit-input-id block
|
||||
(or
|
||||
(publishing-enable-editing?)
|
||||
(not @publishing?)))
|
||||
(not common-config/PUBLISHING)))
|
||||
(let [block-element (gdom/getElement (string/replace edit-input-id "edit-block" "ls-block"))
|
||||
container (util/get-block-container block-element)
|
||||
block (if container
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
[rum.core :as rum]
|
||||
[clojure.core.async :as async]
|
||||
[frontend.pubsub :as pubsub]
|
||||
[datascript.impl.entity :as de]))
|
||||
[datascript.impl.entity :as de]
|
||||
[logseq.common.config :as common-config]))
|
||||
#?(:cljs (:import [goog.async Debouncer]))
|
||||
(:require
|
||||
[clojure.pprint]
|
||||
@@ -150,8 +151,7 @@
|
||||
(def nfs? (and (not (electron?))
|
||||
(not (mobile-util/native-platform?))))
|
||||
(def web-platform? nfs?)
|
||||
(def plugin-platform? (or web-platform? (electron?)))))
|
||||
|
||||
(def plugin-platform? (or (and web-platform? (not common-config/PUBLISHING)) (electron?)))))
|
||||
#?(:cljs
|
||||
(defn file-protocol?
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user