Fix linter warnings and errors across version-related namespaces

frontend/src/app/main/ui/workspace.cljs:
- Remove unused requires: app.common.data, app.main.data.notifications,
  app.main.data.workspace.versions

frontend/src/app/main/data/workspace/versions.cljs:
- Remove unused require: app.common.uuid
- Fix duplicate reify type: enter-restore used ::restore-version
  (same as the private restore-version fn), renamed to ::enter-restore
- Remove unused bindings: state in enter-restore, team-id in
  exit-preview and restore-version-from-plugin
This commit is contained in:
Andrey Antukh 2026-04-23 19:38:10 +00:00
parent 4ca8af3347
commit 809515a797
2 changed files with 13 additions and 19 deletions

View File

@ -11,7 +11,6 @@
[app.common.logging :as log]
[app.common.schema :as sm]
[app.common.time :as ct]
[app.common.uuid :as uuid]
[app.main.data.event :as ev]
[app.main.data.helpers :as dsh]
[app.main.data.notifications :as ntf]
@ -194,9 +193,9 @@
(defn enter-restore
[id]
(assert (uuid? id) "expected valid uuid for `id`")
(ptk/reify ::restore-version
(ptk/reify ::enter-restore
ptk/WatchEvent
(watch [_ state _]
(watch [_ _ _]
(let [output-s (rx/subject)]
(rx/merge
output-s
@ -241,8 +240,7 @@
ptk/WatchEvent
(watch [_ state _]
(let [team-id (:current-team-id state)
file-id (:current-file-id state)
(let [file-id (:current-file-id state)
page-id (:current-page-id state)]
(rx/of (dwpg/initialize-page file-id page-id))))))
@ -366,19 +364,18 @@
(ptk/reify ::restore-version-from-plugins
ptk/WatchEvent
(watch [_ state _]
(let [team-id (:current-team-id state)]
(rx/concat
(rx/of (ev/event {::ev/name "restore-version"
::ev/origin "plugins"})
::dwp/force-persist)
(watch [_ _ _]
(rx/concat
(rx/of (ev/event {::ev/name "restore-version"
::ev/origin "plugins"})
::dwp/force-persist)
(->> (wait-for-persistence file-id id)
(rx/map #(initialize-version)))
(->> (wait-for-persistence file-id id)
(rx/map #(initialize-version)))
(->> (rx/of 1)
(rx/tap resolve)
(rx/ignore)))))))
(->> (rx/of 1)
(rx/tap resolve)
(rx/ignore))))))

View File

@ -7,15 +7,12 @@
(ns app.main.ui.workspace
(:require-macros [app.main.style :as stl])
(:require
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.main.data.common :as dcm]
[app.main.data.helpers :as dsh]
[app.main.data.notifications :as ntf]
[app.main.data.persistence :as dps]
[app.main.data.plugins :as dpl]
[app.main.data.workspace :as dw]
[app.main.data.workspace.versions :as dwv]
[app.main.features :as features]
[app.main.refs :as refs]
[app.main.router :as-alias rt]