Просмотр исходного кода

enhance(sync): update prod config, add :pre for update-graphs-txid

rcmerci 3 лет назад
Родитель
Сommit
f29aea9e55
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 0
      src/main/frontend/config.cljs
  2. 3 1
      src/main/frontend/fs/sync.cljs

+ 1 - 0
src/main/frontend/config.cljs

@@ -23,6 +23,7 @@
 ;; (goog-define LOGIN-URL
 ;;              "https://logseq.auth.us-east-1.amazoncognito.com/login?client_id=7ns5v1pu8nrbs04rvdg67u4a7c&response_type=code&scope=email+openid+phone&redirect_uri=logseq%3A%2F%2Fauth-callback")
 ;; (goog-define API-DOMAIN "api-prod.logseq.com")
+;; (goog-define WS-URL "wss://b2rp13onu2.execute-api.us-east-1.amazonaws.com/production?graphuuid=%s")
 
 ;; dev env
 (goog-define FILE-SYNC-PROD? false)

+ 3 - 1
src/main/frontend/fs/sync.cljs

@@ -107,7 +107,9 @@
 
 (def graphs-txid (persist-var/persist-var nil "graphs-txid"))
 
-(defn update-graphs-txid! [latest-txid graph-uuid user-uuid repo]
+(defn update-graphs-txid!
+  [latest-txid graph-uuid user-uuid repo]
+  {:pre [(int? latest-txid) (>= latest-txid 0)]}
   (persist-var/-reset-value! graphs-txid [user-uuid graph-uuid latest-txid] repo)
   (persist-var/persist-save graphs-txid))