mirror of
https://github.com/status-im/status-react.git
synced 2025-01-22 08:49:22 +00:00
update status js api according to latest changes in web3 opt-in EIP
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
bca9ae25af
commit
b754092710
@ -20,8 +20,9 @@ WebViewBridge.onMessage = function (message) {
|
||||
}
|
||||
else
|
||||
{
|
||||
window.STATUS_API = data.data;
|
||||
window.postMessage({ type: 'STATUS_API_SUCCESS', permissions: data.keys }, "*");
|
||||
window.dispatchEvent(new CustomEvent('statusapi', { detail: { permissions: data.keys,
|
||||
data: data.data
|
||||
} }));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,14 +78,17 @@
|
||||
{:db (assoc-in db [:browser/options :show-permission] {:requested-permission requested-permission
|
||||
:params params})})
|
||||
{:dispatch [:next-dapp-permission params]}))
|
||||
(assoc (update-dapp-permissions-fx cofx {:dapp dapp-name
|
||||
:permissions (vec (set (concat (keys permissions-allowed)
|
||||
user-permissions)))})
|
||||
:send-to-bridge-fx [{:type constants/status-api-success
|
||||
:data permissions-allowed
|
||||
:keys (keys permissions-allowed)}
|
||||
(:webview-bridge db)]
|
||||
:dispatch [:check-permissions-queue])))
|
||||
(cond-> (update-dapp-permissions-fx cofx {:dapp dapp-name
|
||||
:permissions (vec (set (concat (keys permissions-allowed)
|
||||
user-permissions)))})
|
||||
(not (zero? (count permissions-allowed)))
|
||||
(assoc :send-to-bridge-fx [{:type constants/status-api-success
|
||||
:data permissions-allowed
|
||||
:keys (keys permissions-allowed)}
|
||||
(:webview-bridge db)])
|
||||
|
||||
true
|
||||
(assoc :dispatch [:check-permissions-queue]))))
|
||||
|
||||
(defn next-permission [{:keys [params permission permissions-data]} cofx]
|
||||
(request-permission
|
||||
|
Loading…
x
Reference in New Issue
Block a user