Skip to content

Commit

Permalink
fix: open whiteboards for beta
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Dec 16, 2022
1 parent 2bf07a3 commit 561b16f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/frontend/components/settings.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
(ui/toggle enabled?
(fn []
(let [value (not enabled?)]
(when (user-handler/alpha-or-beta-user?)
(when (user-handler/feature-available? :whiteboard)
(config-handler/set-config! :feature/enable-whiteboards? value))))
true))

Expand Down
3 changes: 1 addition & 2 deletions src/main/frontend/components/whiteboard.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@

(rum/defc whiteboard-route
[route-match]
(when (user-handler/alpha-or-beta-user?)
(when (user-handler/feature-available? :whiteboard)
(let [name (get-in route-match [:parameters :path :name])
{:keys [block-id]} (get-in route-match [:parameters :query])]
(whiteboard-page name block-id))))
Expand All @@ -300,7 +300,6 @@
[]
(when (and (user-handler/feature-available? :whiteboard)
(not (or (state/sub :whiteboard/onboarding-tour?)
(state/enable-whiteboards?)
(util/mobile?))))
(state/pub-event! [:whiteboard/onboarding])
(state/set-state! [:whiteboard/onboarding-tour?] true)
Expand Down
13 changes: 7 additions & 6 deletions src/main/frontend/handler/user.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,13 @@
(or (alpha-user?) (beta-user?)))

(defonce feature-matrix {:file-sync :beta
:whiteboard :alpha})
:whiteboard :beta})

(defn feature-available?
[feature]
(when (logged-in?)
(case (feature feature-matrix)
:beta (alpha-or-beta-user?)
:alpha (alpha-user?)
false)))
(or config/dev?
(when (logged-in?)
(case (feature feature-matrix)
:beta (alpha-or-beta-user?)
:alpha (alpha-user?)
false))))

0 comments on commit 561b16f

Please sign in to comment.