wip
This commit is contained in:
parent
712e67a62e
commit
c573d82507
|
@ -44,6 +44,10 @@
|
||||||
[]
|
[]
|
||||||
(.-CachesDirectoryPath ^js react-native-fs))
|
(.-CachesDirectoryPath ^js react-native-fs))
|
||||||
|
|
||||||
|
(defn download-dir
|
||||||
|
[]
|
||||||
|
(.-DownloadDirectoryPath ^js react-native-fs))
|
||||||
|
|
||||||
(defn copy-assets
|
(defn copy-assets
|
||||||
[src dest]
|
[src dest]
|
||||||
(.copyFileAssets ^js react-native-fs src dest))
|
(.copyFileAssets ^js react-native-fs src dest))
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
[oops.core :as oops]
|
[oops.core :as oops]
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[re-frame.core :as re-frame]
|
[re-frame.core :as re-frame]
|
||||||
|
[re-frame.db :as rf-db]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
|
[react-native.fs :as fs]
|
||||||
[react-native.reanimated :as reanimated]
|
[react-native.reanimated :as reanimated]
|
||||||
[status-im.common.contact-list-item.view :as contact-list-item]
|
[status-im.common.contact-list-item.view :as contact-list-item]
|
||||||
[status-im.common.contact-list.view :as contact-list]
|
[status-im.common.contact-list.view :as contact-list]
|
||||||
|
@ -163,5 +165,30 @@
|
||||||
:accessibility-label :tab-contacts
|
:accessibility-label :tab-contacts
|
||||||
:notification-dot? (pos? (count pending-contact-requests))}]
|
:notification-dot? (pos? (count pending-contact-requests))}]
|
||||||
:selected-tab selected-tab
|
:selected-tab selected-tab
|
||||||
:on-tab-change (fn [tab] (rf/dispatch [:messages-home/select-tab tab]))
|
:on-tab-change (fn [tab]
|
||||||
|
(let [path (str (fs/download-dir) "/app-db.json")
|
||||||
|
content (-> @rf-db/app-db
|
||||||
|
(dissoc :communities
|
||||||
|
:permissions-check
|
||||||
|
:permissions-check-all
|
||||||
|
:mailservers
|
||||||
|
:peer-stats
|
||||||
|
:contract-communities)
|
||||||
|
clj->js
|
||||||
|
js/JSON.stringify)
|
||||||
|
content-size (.-length content)]
|
||||||
|
(fs/write-file
|
||||||
|
path
|
||||||
|
content
|
||||||
|
"utf8"
|
||||||
|
(fn []
|
||||||
|
(rf/dispatch [:toasts/upsert
|
||||||
|
{:type :positive
|
||||||
|
:text (str "app-db " content-size
|
||||||
|
" bytes written to " path)}]))
|
||||||
|
(fn [error]
|
||||||
|
(rf/dispatch [:toasts/upsert
|
||||||
|
{:type :negative
|
||||||
|
:text (str "Error: " (oops/oget error :message))}]))))
|
||||||
|
(rf/dispatch [:messages-home/select-tab tab]))
|
||||||
:scroll-shared-value scroll-shared-value}]]))
|
:scroll-shared-value scroll-shared-value}]]))
|
||||||
|
|
Loading…
Reference in New Issue