[#4755] Keep the transaction source intact on errors/discards.

If a tx was send from a chat, that fact is recorded in its properties, `from-chat?` property.
On errors and discards, this property was reset to `false`, hence, making any chat transaction editable if an error happens or user discards it.
This commit makes this property stay as it is.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Igor Mandrigin 2018-06-14 11:03:24 +03:00
parent 6f209ec4c0
commit 0d45683935
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
1 changed files with 3 additions and 2 deletions

View File

@ -118,7 +118,6 @@
:signing? false
:wrong-password? false
:waiting-signal? false
:from-chat? false
:password nil})
(defn on-transactions-completed [raw-results]
@ -175,7 +174,9 @@
new-db (assoc-in db' [:wallet :transactions-unsigned id] transaction)
sending-db {:id id
:method method
:from-chat? sending-from-bot-or-dapp?}]
:from-chat? (or
sending-from-bot-or-dapp?
(get-in db [:wallet :send-transaction :from-chat?]))}]
(if sending-from-bot-or-dapp?
;;SENDING FROM BOT (CHAT) OR DAPP
{:db (assoc-in new-db [:wallet :send-transaction] sending-db) ; we need to completely reset sending state here