2016-05-19 18:31:56 +02:00
|
|
|
(ns status-im.db
|
2016-05-30 16:50:23 +03:00
|
|
|
(:require [schema.core :as s :include-macros true]
|
|
|
|
[status-im.components.react :refer [animated]]
|
|
|
|
[status-im.components.animation :as anim]))
|
2016-03-23 16:48:26 +02:00
|
|
|
|
|
|
|
;; schema of app-db
|
|
|
|
(def schema {:greeting s/Str})
|
|
|
|
|
2016-05-11 10:36:13 +03:00
|
|
|
(def default-view :chat-list)
|
2016-05-06 14:06:58 +03:00
|
|
|
|
2016-03-23 16:48:26 +02:00
|
|
|
;; initial state of app-db
|
2016-05-19 19:29:17 +03:00
|
|
|
(def app-db {:identity-password "replace-me-with-user-entered-password"
|
|
|
|
:identity "me"
|
2016-07-18 15:42:48 +03:00
|
|
|
:is-logged-in false
|
2016-06-30 18:06:05 +03:00
|
|
|
:accounts {}
|
2016-07-18 15:42:48 +03:00
|
|
|
:user-identity nil
|
2016-05-19 19:29:17 +03:00
|
|
|
:contacts []
|
|
|
|
:contacts-ids #{}
|
|
|
|
:selected-contacts #{}
|
|
|
|
:current-chat-id "console"
|
|
|
|
:chat {:command nil
|
|
|
|
:last-message nil}
|
|
|
|
:chats {}
|
|
|
|
:chats-updated-signal 0
|
|
|
|
:show-actions false
|
2016-05-21 15:23:24 +03:00
|
|
|
:selected-participants #{}
|
2016-07-18 15:42:48 +03:00
|
|
|
:signed-up false
|
2016-05-19 19:29:17 +03:00
|
|
|
:view-id default-view
|
|
|
|
:navigation-stack (list default-view)
|
2016-05-11 13:05:33 +03:00
|
|
|
;; TODO fix hardcoded values
|
2016-05-24 11:02:08 +03:00
|
|
|
:photo-path nil
|
2016-05-19 19:29:17 +03:00
|
|
|
:username "My Name"
|
|
|
|
:phone-number "3147984309"
|
|
|
|
:email "myemail@gmail.com"
|
|
|
|
:status "Hi, this is my status"
|
|
|
|
:current-tag nil
|
2016-06-02 17:39:26 +03:00
|
|
|
:qr-codes {}
|
2016-06-01 11:41:50 +03:00
|
|
|
:new-contact {:name ""
|
|
|
|
:address ""
|
|
|
|
:whisper-identity ""
|
|
|
|
:phone-number ""}
|
2016-05-30 16:50:23 +03:00
|
|
|
:disable-group-creation false
|
2016-07-08 18:30:16 +03:00
|
|
|
:animations {;; todo clear this
|
2016-06-16 12:44:56 +03:00
|
|
|
:tabs-bar-value (anim/create-value 0)}})
|
2016-03-23 21:05:42 +02:00
|
|
|
|
|
|
|
(def protocol-initialized-path [:protocol-initialized])
|
2016-04-05 17:00:49 +03:00
|
|
|
(defn chat-input-text-path [chat-id]
|
|
|
|
[:chats chat-id :input-text])
|
2016-04-21 12:26:05 +03:00
|
|
|
(defn chat-staged-commands-path [chat-id]
|
|
|
|
[:chats chat-id :staged-commands])
|
2016-04-05 17:00:49 +03:00
|
|
|
(defn chat-command-path [chat-id]
|
|
|
|
[:chats chat-id :command-input :command])
|
2016-04-08 20:08:40 +03:00
|
|
|
(defn chat-command-to-msg-id-path [chat-id]
|
|
|
|
[:chats chat-id :command-input :to-msg-id])
|
2016-04-05 17:00:49 +03:00
|
|
|
(defn chat-command-content-path [chat-id]
|
|
|
|
[:chats chat-id :command-input :content])
|
2016-04-08 20:08:40 +03:00
|
|
|
(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])
|