mirror of
https://github.com/status-im/status-app.git
synced 2026-08-27 15:11:20 +00:00
* fix(browser): fix pr comments * fix(browser): fix offset between navigation and webview * fix(browser): split logic into contexts * dialogs * favorites * webview * fix(browser): crash when webview tries to render and destroy at the same time * fix(browser): opened dialogs counter * fix(browser): load platform-specific webview * fix(wc): unused wc files * fix(browser): separate dapps and websocket logic * fix(browser): fix pr comments * fix(browser): fix popup tracker * fix(browser): fix pr * fix(browser): fix PR * fix(browser): fix PR
44 lines
1.4 KiB
QML
44 lines
1.4 KiB
QML
import QtQuick
|
|
import StatusQ.Core.Utils as SQUtils
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
required property var networksStore
|
|
required property var browserActivityStore
|
|
required property var browserWalletStore
|
|
required property var openPopupFn
|
|
required property Component jsDialogComponent
|
|
required property Item dialogParent
|
|
|
|
function openHistoryMenu(historyMenu) {
|
|
historyMenu.open()
|
|
}
|
|
|
|
function openSettingsMenu(settingsMenu) {
|
|
settingsMenu.open()
|
|
}
|
|
|
|
function openWalletMenu(browserWalletMenu) {
|
|
// Initialize activity filters before opening popup.
|
|
const activeChainIds = SQUtils.ModelUtils.modelToFlatArray(
|
|
networksStore.activeNetworks, "chainId")
|
|
if (activeChainIds.length > 0) {
|
|
browserActivityStore.activityController.setFilterChainsJson(
|
|
JSON.stringify(activeChainIds), true)
|
|
}
|
|
|
|
const currentAddress = browserWalletStore.dappBrowserAccount.address
|
|
browserActivityStore.activityController.setFilterAddressesJson(
|
|
JSON.stringify([currentAddress]))
|
|
openPopupFn(browserWalletMenu)
|
|
}
|
|
|
|
function openJsDialog(request) {
|
|
request.accepted = true
|
|
var dialog = jsDialogComponent.createObject(dialogParent, {"request": request})
|
|
if (dialog)
|
|
dialog.open()
|
|
}
|
|
}
|