Fixed regression when sending transaction

Remove obsolete realm
This commit is contained in:
Julien Eluard 2017-11-29 16:59:01 +01:00 committed by Jan Herich
parent c6f44cc852
commit 7f2085fb14
9 changed files with 12 additions and 79 deletions

View File

@ -7,7 +7,6 @@
[status-im.chat.models.unviewed-messages :as unviewed-messages-model]
[status-im.chat.sign-up :as sign-up]
[status-im.chat.constants :as chat-const]
[status-im.data-store.handler-data :as handler-data]
[status-im.data-store.messages :as msg-store]
[status-im.data-store.contacts :as contacts-store]
[status-im.data-store.chats :as chats-store]
@ -203,7 +202,6 @@
(into {}))]
(-> new-db
(assoc-in [:message-data :preview] message-previews)
(assoc :handler-data (handler-data/get-all))
(assoc :chats chats)
init-console-chat
(update :dispatch-n conj event)))))))

View File

@ -11,7 +11,6 @@
(s/def :chat/layout-height (s/nilable number?)) ;;height of chat's view layout
(s/def :chat/expandable-view-height-to-value (s/nilable number?))
(s/def :chat/loading-allowed (s/nilable boolean?)) ;;allow to load more messages
(s/def :chat/handler-data (s/nilable map?))
(s/def :chat/message-data (s/nilable map?))
(s/def :chat/message-id->transaction-id (s/nilable map?))
(s/def :chat/message-status (s/nilable map?))

View File

@ -1,10 +0,0 @@
(ns status-im.data-store.commands
(:require [status-im.data-store.realm.commands :as data-store]))
(defn get-by-chat-id
[chat-id]
(data-store/get-by-chat-id chat-id))
(defn save
[command]
(data-store/save command))

View File

@ -1,16 +0,0 @@
(ns status-im.data-store.handler-data
(:require [cljs.reader :as reader]
[status-im.data-store.realm.handler-data :as data-store]
[taoensso.timbre :as log]))
(defn get-all []
(->> (data-store/get-all-as-list)
(map (fn [{:keys [message-id data]}]
[message-id (reader/read-string data)]))
(into {})))
(defn get-data [message-id]
(-> message-id data-store/get-by-message-id :data reader/read-string))
(defn save-data [handler-data]
(data-store/save (update handler-data :data pr-str)))

View File

@ -1,11 +0,0 @@
(ns status-im.data-store.realm.commands
(:require [status-im.data-store.realm.core :as realm]))
(defn get-by-chat-id
[chat-id]
(realm/get-one-by-field-clj @realm/account-realm :command
:chat-id chat-id))
(defn save
[command]
(realm/save @realm/account-realm :command command true))

View File

@ -1,16 +0,0 @@
(ns status-im.data-store.realm.handler-data
(:require [status-im.data-store.realm.core :as realm]))
(defn get-all []
(realm/get-all @realm/account-realm :handler-data))
(defn get-all-as-list []
(realm/js-object->clj (get-all)))
(defn get-by-message-id
[message-id]
(realm/get-one-by-field-clj @realm/account-realm :handler-data :message-id message-id))
(defn save
[handler-data]
(realm/save @realm/account-realm :handler-data handler-data true))

View File

@ -1,11 +1,8 @@
(ns status-im.data-store.realm.schemas.account.v19.core
(:require [status-im.data-store.realm.schemas.account.v11.chat :as chat]
[status-im.data-store.realm.schemas.account.v1.chat-contact :as chat-contact]
[status-im.data-store.realm.schemas.account.v6.command :as command]
[status-im.data-store.realm.schemas.account.v9.command-parameter :as command-parameter]
[status-im.data-store.realm.schemas.account.v19.contact :as contact]
[status-im.data-store.realm.schemas.account.v1.discover :as discover]
[status-im.data-store.realm.schemas.account.v1.kv-store :as kv-store]
[status-im.data-store.realm.schemas.account.v10.message :as message]
[status-im.data-store.realm.schemas.account.v12.pending-message :as pending-message]
[status-im.data-store.realm.schemas.account.v1.processed-message :as processed-message]
@ -15,17 +12,13 @@
[status-im.data-store.realm.schemas.account.v5.contact-group :as contact-group]
[status-im.data-store.realm.schemas.account.v5.group-contact :as group-contact]
[status-im.data-store.realm.schemas.account.v8.local-storage :as local-storage]
[status-im.data-store.realm.schemas.account.v13.handler-data :as handler-data]
[taoensso.timbre :as log]
[cljs.reader :as reader]))
(def schema [chat/schema
chat-contact/schema
command/schema
command-parameter/schema
contact/schema
discover/schema
kv-store/schema
message/schema
pending-message/schema
processed-message/schema
@ -34,8 +27,7 @@
user-status/schema
contact-group/schema
group-contact/schema
local-storage/schema
handler-data/schema])
local-storage/schema])
(defn remove-contact! [new-realm whisper-identity]
(when-let [contact (some-> new-realm

View File

@ -1,12 +1,10 @@
(ns status-im.data-store.realm.schemas.base.v4.core
(:require [status-im.data-store.realm.schemas.base.v4.network :as network]
[status-im.data-store.realm.schemas.base.v4.account :as account]
[status-im.data-store.realm.schemas.base.v1.kv-store :as kv-store]
[taoensso.timbre :as log]))
(def schema [network/schema
account/schema
kv-store/schema])
account/schema])
(defn migration [old-realm new-realm]
(log/debug "migrating v4 base database: " old-realm new-realm)

View File

@ -164,7 +164,6 @@
:chat/public-group-topic
:chat/confirmation-code-sms-listener
:chat/messages
:chat/handler-data
:chat/loaded-chats
:chat/raw-unviewed-messages
:chat/bot-db