mirror of
https://github.com/status-im/status-react.git
synced 2025-01-30 20:55:03 +00:00
fb22a08b79
Former-commit-id: 544571e3a7c4ce4ab04df0ba2e30ffb65ce4e70d
48 lines
1.8 KiB
Clojure
48 lines
1.8 KiB
Clojure
(ns syng-im.db
|
|
(:require [schema.core :as s :include-macros true]))
|
|
|
|
;; schema of app-db
|
|
(def schema {:greeting s/Str})
|
|
|
|
(def default-view :discovery)
|
|
|
|
;; initial state of app-db
|
|
(def app-db {:greeting "Hello Clojure in iOS and Android!"
|
|
:identity-password "replace-me-with-user-entered-password"
|
|
:identity "me"
|
|
:contacts []
|
|
:current-chat-id "console"
|
|
:chat {:command nil
|
|
:last-message nil}
|
|
:chats {}
|
|
:chats-updated-signal 0
|
|
:show-actions false
|
|
:new-group #{}
|
|
:new-participants #{}
|
|
:signed-up false
|
|
:view-id default-view
|
|
:navigation-stack (list default-view)
|
|
:name "My Name"
|
|
:current-tag nil})
|
|
|
|
(def protocol-initialized-path [:protocol-initialized])
|
|
(def identity-password-path [:identity-password])
|
|
(def updated-chats-signal-path [:chats-updated-signal])
|
|
(defn chat-input-text-path [chat-id]
|
|
[:chats chat-id :input-text])
|
|
(defn chat-staged-commands-path [chat-id]
|
|
[:chats chat-id :staged-commands])
|
|
(defn chat-command-path [chat-id]
|
|
[:chats chat-id :command-input :command])
|
|
(defn chat-command-to-msg-id-path [chat-id]
|
|
[:chats chat-id :command-input :to-msg-id])
|
|
(defn chat-command-content-path [chat-id]
|
|
[:chats chat-id :command-input :content])
|
|
(defn chat-command-requests-path [chat-id]
|
|
[:chats chat-id :command-requests])
|
|
(defn chat-command-request-path [chat-id msg-id]
|
|
[:chats chat-id :command-requests msg-id])
|
|
(def updated-discoveries-signal-path [:discovery-updated-signal])
|
|
(def current-tag-path [:current-tag])
|
|
(def updated-current-tag-signal-path [:current-tag-updated-signal])
|