Skip to content

Commit

Permalink
Merge branch 'main' into forward-back-keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjeff0 authored Jan 13, 2022
2 parents 9faa19b + c672f2b commit a719311
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cljs/athens/electron/boot.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@
:dispatch-n [[:navigate :home]
[:left-sidebar/toggle]]}

;; if nth time, remember dark/light theme and last page
;; if nth time, remember dark/light theme
{:when :seen?
:events :reset-conn
:dispatch-n [[:fs/update-write-db]
[:db/sync]
[:restore-navigation]
;; [:restore-navigation]
[:posthog/set-super-properties]
[:loading/unset]]
;; This event ends the async flow successfully.
:halt? true}
Expand Down
1 change: 1 addition & 0 deletions src/cljs/athens/electron/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[athens.electron.boot]
[athens.electron.db-picker]
[athens.electron.fs]
[athens.electron.monitoring.core]
[athens.electron.window]
[athens.util :as util]
[day8.re-frame.async-flow-fx]
Expand Down
21 changes: 21 additions & 0 deletions src/cljs/athens/electron/monitoring/core.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(ns athens.electron.monitoring.core
(:require
[athens.electron.db-picker :as db-picker]
[athens.electron.utils :as utils]
[athens.util :as util]
[re-frame.core :as rf]))


;; https://posthog.com/docs/integrate/client/js#super-properties
(rf/reg-event-fx
:posthog/set-super-properties
(fn [{:keys [db]} _]
(let [selected-db (db-picker/selected-db db)
remote-db? (utils/remote-db? selected-db)
graph-type {:graph-type (if remote-db?
:self-hosted
:local)}
electron-build {:electron-build-version (util/athens-version)}
super-properties (merge graph-type electron-build)
js-super-properties (clj->js super-properties)]
(.. js/posthog (register js-super-properties)))))
1 change: 1 addition & 0 deletions src/cljs/athens/router.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
[:editing/first-child parent-uid])]}))))))


;; doesn't reliably work. notably, Daily Notes are often not remembered as last open page, leading to incorrect restore
(reg-event-fx
:restore-navigation
(fn [{:keys [db]} _]
Expand Down

0 comments on commit a719311

Please sign in to comment.