diff --git a/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBroker.qml b/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBroker.qml index da888f7b8ad..77480e14527 100644 --- a/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBroker.qml +++ b/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBroker.qml @@ -126,6 +126,14 @@ QtObject { } } + const onDestructionHandler = () => { + if(!d.managedSubscriptions.hasOwnProperty(subscriptionId)) + return + + root.unsubscribed.disconnect(onUnsubscribedHandler) //object is destroyed, no need to listen to the signal anymore + unsubscribe(subscriptionId) + } + const onUnsubscribedHandler = (subscriptionId) => { if(subscriptionId !== subscription.subscriptionId) return @@ -135,14 +143,6 @@ QtObject { subscription.topicChanged.disconnect(onTopicChangeHandler) } - const onDestructionHandler = () => { - if(!d.managedSubscriptions.hasOwnProperty(subscriptionId)) - return - - root.unsubscribed.disconnect(onUnsubscribedHandler) //object is destroyed, no need to listen to the signal anymore - unsubscribe(subscriptionId) - } - subscription.Component.onDestruction.connect(onDestructionHandler) subscription.isReadyChanged.connect(onReadyChangeHandler) subscription.topicChanged.connect(onTopicChangeHandler) diff --git a/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBrokerCommunities.qml b/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBrokerCommunities.qml index 6aa261680fc..5d7e7309462 100644 --- a/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBrokerCommunities.qml +++ b/ui/StatusQ/src/StatusQ/Core/Utils/SubscriptionBrokerCommunities.qml @@ -116,6 +116,14 @@ QtObject { } } + const onDestructionHandler = () => { + if(!d.managedSubscriptions.hasOwnProperty(subscriptionId)) + return + + root.unsubscribed.disconnect(onUnsubscribedHandler) //object is destroyed, no need to listen to the signal anymore + unsubscribe(subscriptionId) + } + const onUnsubscribedHandler = (subscriptionId) => { if(subscriptionId !== subscription.subscriptionId) return @@ -125,14 +133,6 @@ QtObject { subscription.topicChanged.disconnect(onTopicChangeHandler) } - const onDestructionHandler = () => { - if(!d.managedSubscriptions.hasOwnProperty(subscriptionId)) - return - - root.unsubscribed.disconnect(onUnsubscribedHandler) //object is destroyed, no need to listen to the signal anymore - unsubscribe(subscriptionId) - } - subscription.Component.onDestruction.connect(onDestructionHandler) subscription.isReadyChanged.connect(onReadyChangeHandler) subscription.topicChanged.connect(onTopicChangeHandler) diff --git a/ui/app/AppLayouts/Browser/BrowserLayout.qml b/ui/app/AppLayouts/Browser/BrowserLayout.qml index 862aad49691..f6b46292e51 100644 --- a/ui/app/AppLayouts/Browser/BrowserLayout.qml +++ b/ui/app/AppLayouts/Browser/BrowserLayout.qml @@ -18,6 +18,7 @@ import shared.stores.send import AppLayouts.Browser.stores as BrowserStores +import "provider/qml" import "popups" import "controls" import "views" @@ -33,14 +34,12 @@ StatusSectionLayout { required property bool thirdpartyServicesEnabled required property TransactionStore transactionStore - required property var assetsStore - required property var currencyStore - required property var tokensStore required property BrowserStores.BookmarksStore bookmarksStore required property BrowserStores.DownloadsStore downloadsStore required property BrowserStores.BrowserRootStore browserRootStore required property BrowserStores.BrowserWalletStore browserWalletStore + required property var connectorController signal sendToRecipientRequested(string address) @@ -49,6 +48,22 @@ StatusSectionLayout { tab.url = _internal.determineRealURL(url) } + ConnectorBridge { + id: connectorBridge + + userUID: root.userUID + connectorController: root.connectorController + defaultAccountAddress: root.browserWalletStore.dappBrowserAccount.address + accountsModel: root.browserWalletStore.accounts + httpUserAgent: { + if (localAccountSensitiveSettings.compatibilityMode) { + // Google doesn't let you connect if the user agent is Chrome-ish and doesn't satisfy some sort of hidden requirement + return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" + } + return "" + } + } + QtObject { id: _internal @@ -91,32 +106,13 @@ StatusSectionLayout { standardButtons: Dialog.Ok } - property QtObject defaultProfile: WebEngineProfile { - storageName: "Profile_%1".arg(root.userUID) - offTheRecord: false - httpUserAgent: { - if (localAccountSensitiveSettings.compatibilityMode) { - // Google doesn't let you connect if the user agent is Chrome-ish and doesn't satisfy some sort of hidden requirement - return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" - } - return "" - } - } - - property QtObject otrProfile: WebEngineProfile { - storageName: "IncognitoProfile_%1".arg(root.userUID) - offTheRecord: true - persistentCookiesPolicy: WebEngineProfile.NoPersistentCookies - httpUserAgent: _internal.defaultProfile.httpUserAgent - } - function addNewDownloadTab() { - tabs.createDownloadTab(tabs.count !== 0 ? currentWebView.profile : defaultProfile); + tabs.createDownloadTab(tabs.count !== 0 ? currentWebView.profile : connectorBridge.defaultProfile); tabs.currentIndex = tabs.count - 1; } function addNewTab() { - var tab = tabs.createEmptyTab(tabs.count !== 0 ? currentWebView.profile : defaultProfile); + var tab = tabs.createEmptyTab(tabs.count !== 0 ? currentWebView.profile : connectorBridge.defaultProfile); browserHeader.addressBar.forceActiveFocus(); browserHeader.addressBar.selectAll(); @@ -218,9 +214,9 @@ StatusSectionLayout { } onOpenNewTabTriggered: _internal.addNewTab() Component.onCompleted: { - _internal.defaultProfile.downloadRequested.connect(_internal.onDownloadRequested); - _internal.otrProfile.downloadRequested.connect(_internal.onDownloadRequested); - var tab = createEmptyTab(_internal.defaultProfile, true); + connectorBridge.defaultProfile.downloadRequested.connect(_internal.onDownloadRequested); + connectorBridge.otrProfile.downloadRequested.connect(_internal.onDownloadRequested); + var tab = createEmptyTab(connectorBridge.defaultProfile, true); // For Devs: Uncomment the next line if you want to use the simpledapp on first load // tab.url = root.browserRootStore.determineRealURL("https://simpledapp.eth"); } @@ -312,11 +308,11 @@ StatusSectionLayout { id: settingsMenu x: parent.width - width y: browserHeader.y + browserHeader.height - isIncognito: _internal.currentWebView && _internal.currentWebView.profile === _internal.otrProfile + isIncognito: _internal.currentWebView && _internal.currentWebView.profile === connectorBridge.otrProfile onAddNewTab: _internal.addNewTab() onGoIncognito: function (checked) { if (_internal.currentWebView) { - _internal.currentWebView.profile = checked ? _internal.otrProfile : _internal.defaultProfile; + _internal.currentWebView.profile = checked ? connectorBridge.otrProfile : connectorBridge.defaultProfile; } } onZoomIn: { @@ -352,9 +348,6 @@ StatusSectionLayout { Component { id: browserWalletMenu BrowserWalletMenu { - assetsStore: root.assetsStore - currencyStore: root.currencyStore - tokensStore: root.tokensStore currentTabConnected: root.browserRootStore.currentTabConnected browserWalletStore: root.browserWalletStore property point headerPoint: Qt.point(browserHeader.x, browserHeader.y) @@ -455,7 +448,7 @@ StatusSectionLayout { bookmarksStore: root.bookmarksStore downloadsStore: root.downloadsStore currentWebView: _internal.currentWebView - webChannel: channel + webChannel: connectorBridge.webChannel findBarComp: findBar favMenu: favoriteMenu addFavModal: addFavoriteModal @@ -542,6 +535,11 @@ StatusSectionLayout { function onUrlChanged() { browserHeader.addressBar.text = root.browserRootStore.obtainAddress(_internal.currentWebView.url) root.browserRootStore.currentTabConnected = false // TODO: Will be handled by connector + + // Update ConnectorBridge with current dApp metadata + if (_internal.currentWebView && _internal.currentWebView.url) { + connectorBridge.updateDAppUrl(_internal.currentWebView.url, _internal.currentWebView.title) + } } } diff --git a/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml b/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml index 95a8572a2c0..70c7b61fab9 100644 --- a/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml +++ b/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml @@ -18,10 +18,6 @@ import AppLayouts.Browser.stores as BrowserStores Dialog { id: root - required property var assetsStore - required property var currencyStore - required property var tokensStore - required property bool currentTabConnected required property BrowserStores.BrowserWalletStore browserWalletStore @@ -193,42 +189,11 @@ Dialog { anchors.topMargin: Theme.bigPadding anchors.bottom: parent.bottom - StatusTabBar { - id: walletTabBar - width: parent.width - anchors.top: parent.top - - StatusTabButton { - id: assetBtn - width: implicitWidth - text: qsTr("Assets") - } - StatusTabButton { - id: historyBtn - width: implicitWidth - text: qsTr("History") - } - } - - StackLayout { - id: stackLayout - width: parent.width - anchors.top: walletTabBar.bottom - anchors.topMargin: Theme.bigPadding - anchors.bottom: parent.bottom - currentIndex: walletTabBar.currentIndex - - // FIXME integrate - // AssetsView { - // id: assetsTab - // controller: root.assetsStore.assetsController - // currencyStore: root.currencyStore - // tokensStore: root.tokensStore - // } - HistoryView { - id: historyTab - overview: root.browserWalletStore.dappBrowserAccount - } + // TODO: Add Assets and History tabs when ready + StatusBaseText { + anchors.centerIn: parent + text: qsTr("Wallet info will appear here") + color: Theme.palette.baseColor1 } } onClosed: { diff --git a/ui/app/AppLayouts/Browser/provider/qml/ConnectorBridge.qml b/ui/app/AppLayouts/Browser/provider/qml/ConnectorBridge.qml index 8e086b91d24..46eaca4d48a 100644 --- a/ui/app/AppLayouts/Browser/provider/qml/ConnectorBridge.qml +++ b/ui/app/AppLayouts/Browser/provider/qml/ConnectorBridge.qml @@ -5,16 +5,15 @@ import QtWebChannel import StatusQ.Core.Theme import utils - import "Utils.js" as Utils /** * ConnectorBridge - * + * * Simplified connector infrastructure for BrowserLayout. - * Provides WebEngine profiles with script injection, WebChannel, + * Provides WebEngine profiles with script injection, WebChannel, * ConnectorManager, and direct connection to Nim backend. - * + * * This component bridges the Browser UI with the Connector backend system. */ Item { @@ -29,15 +28,15 @@ Item { readonly property alias webChannel: channel readonly property alias defaultProfile: defaultProfile readonly property alias otrProfile: otrProfile - + readonly property alias manager: connectorManager - + property alias dappUrl: connectorManager.dappUrl property alias dappOrigin: connectorManager.dappOrigin property alias dappName: connectorManager.dappName property alias dappIconUrl: connectorManager.dappIconUrl property alias clientId: connectorManager.clientId - + function hasWalletConnected(hostname, address) { if (!connectorController) return false @@ -59,10 +58,10 @@ Item { if (!connectorController) return false return connectorController.disconnect(hostname) } - + function updateDAppUrl(url, name) { if (!url) return - + const urlStr = url.toString() connectorManager.dappUrl = urlStr connectorManager.dappOrigin = Utils.normalizeOrigin(urlStr) @@ -107,7 +106,7 @@ Item { ConnectorManager { id: connectorManager connectorController: root.connectorController // (shared_modules/connector/controller.nim) - + dappUrl: "" dappOrigin: "" dappName: "" @@ -134,16 +133,14 @@ Item { Eip1193ProviderAdapter { id: eip1193ProviderAdapter WebChannel.id: "ethereumProvider" - + chainId: "0x" + connectorManager.dappChainId.toString(16) // Convert decimal to hex networkVersion: connectorManager.dappChainId.toString() selectedAddress: connectorManager.accounts.length > 0 ? connectorManager.accounts[0] : "" accounts: connectorManager.accounts connected: connectorManager.connected - function request(args) { - return connectorManager.request(args) - } + onRequestInternal: (args) => connectorManager.request(args) } } diff --git a/ui/app/AppLayouts/Browser/provider/qml/Eip1193ProviderAdapter.qml b/ui/app/AppLayouts/Browser/provider/qml/Eip1193ProviderAdapter.qml index eecc583e8f3..2664e3b02fd 100644 --- a/ui/app/AppLayouts/Browser/provider/qml/Eip1193ProviderAdapter.qml +++ b/ui/app/AppLayouts/Browser/provider/qml/Eip1193ProviderAdapter.qml @@ -2,10 +2,8 @@ import QtQuick 2.15 QtObject { id: root - - // ============================================================================ - // EIP-1193 PUBLIC PROPERTIES (exposed to JS via WebChannel) - // ============================================================================ + + // EIP-1193 PUBLIC PROPERTIES readonly property bool isStatus: true readonly property bool isMetaMask: false property string chainId: "0x1" // hex format for EIP-1193 @@ -13,30 +11,23 @@ QtObject { property string selectedAddress: "" // current active address property var accounts: [] property bool connected: false - - // ============================================================================ + // EIP-1193 EVENTS (for WebChannel) - // ============================================================================ - signal connectEvent(var info) signal disconnectEvent(var error) signal accountsChangedEvent(var accounts) signal chainChangedEvent(string chainId) signal messageEvent(var message) signal requestCompletedEvent(var payload) + signal requestInternal(var args) // Internal signal providerStateChanged() // re-read State - - // ============================================================================ + // EIP-1193 REQUEST METHOD STUB - // ============================================================================ function request(args) { - console.error("[Eip1193ProviderAdapter] request() not injected - should be overridden by ConnectorBridge") - return JSON.stringify({ - jsonrpc: "2.0", - id: args && args.requestId || 0, - error: { code: -32603, message: "Request function not properly injected" } - }) + requestInternal(args) + // Return immediately - async response comes via requestCompletedEvent + return { jsonrpc: "2.0", id: args.requestId || 0, result: null } } } diff --git a/ui/app/AppLayouts/Browser/provider/qml/Utils.js b/ui/app/AppLayouts/Browser/provider/qml/Utils.js index 7047f5f5ae1..617d5909022 100644 --- a/ui/app/AppLayouts/Browser/provider/qml/Utils.js +++ b/ui/app/AppLayouts/Browser/provider/qml/Utils.js @@ -1,3 +1,5 @@ +.pragma library + function accountsDidChange(oldAccounts, newAccounts) { const a = oldAccounts || [] const b = newAccounts || [] @@ -55,6 +57,6 @@ function extractDomainName(urlString) { return urlObj.hostname || "Unknown dApp" } catch (e) { return "Unknown dApp" - } +} } diff --git a/ui/app/AppLayouts/Browser/provider/qml/qmldir b/ui/app/AppLayouts/Browser/provider/qml/qmldir new file mode 100644 index 00000000000..f3fff6bc371 --- /dev/null +++ b/ui/app/AppLayouts/Browser/provider/qml/qmldir @@ -0,0 +1,4 @@ +ConnectorBridge 1.0 ConnectorBridge.qml +ConnectorManager 1.0 ConnectorManager.qml +Eip1193ProviderAdapter 1.0 Eip1193ProviderAdapter.qml + diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index 0a5ba6a3fc2..09b3a993411 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -62,12 +62,12 @@ import SortFilterProxyModel Item { id: appMain - + // Primary store container — all additional stores should be initialized under this root readonly property AppStores.RootStore rootStore: AppStores.RootStore { localBackupEnabled: appMain.featureFlagsStore.localBackupEnabled thirdpartyServicesEnabled: appMain.featureFlagsStore.privacyModeFeatureEnabled ? - appMain.privacyStore.thirdpartyServicesEnabled: true + appMain.privacyStore.thirdpartyServicesEnabled: true onOpenUrl: (link) => Global.openLinkWithConfirmation(link, SQUtils.StringUtils.extractDomainFromLink(link)) } @@ -139,10 +139,6 @@ Item { required property bool isCentralizedMetricsEnabled - function showEnableBiometricsFlow() { - popupRequestsHandler.enableBiometricsPopupHandler.openPopup() - } - AllContactsAdaptor { id: allContacsAdaptor @@ -236,13 +232,13 @@ Item { function onShowToastAccountRemoved(name: string) { Global.displayToastMessage( - qsTr("\"%1\" successfully removed").arg(name), - "", - "checkmark-circle", - false, - Constants.ephemeralNotificationType.success, - "" - ) + qsTr("\"%1\" successfully removed").arg(name), + "", + "checkmark-circle", + false, + Constants.ephemeralNotificationType.success, + "" + ) } function onShowToastKeypairRenamed(oldName: string, newName: string) { @@ -295,9 +291,9 @@ Item { Global.displayToastMessage( notification, "", - error!==""? "info" : "checkmark-circle", + error!==""? "info" : "checkmark-circle", false, - error!==""? Constants.ephemeralNotificationType.normal : Constants.ephemeralNotificationType.success, + error!==""? Constants.ephemeralNotificationType.normal : Constants.ephemeralNotificationType.success, "" ) } @@ -419,367 +415,367 @@ Item { } switch(status) { - case Constants.txStatus.sending: { - toastTitle = qsTr("Sending %1 from %2 to %3") - toastLoading = true - - switch(txType) { - case Constants.SendType.Transfer: { - toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) - break - } - case Constants.SendType.ENSRegister: { - toastTitle = qsTr("Registering %1 ENS name using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSRelease: { - toastTitle = qsTr("Releasing %1 ENS username using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSSetPubKey: { - toastTitle = qsTr("Setting public key %1 using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.StickersBuy: { - toastTitle = qsTr("Purchasing %1 sticker pack using %2").arg(stickersPackName).arg(sender) - break - } - case Constants.SendType.Bridge: { - toastTitle = qsTr("Bridging %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Setting spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.ERC721Transfer: { - toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.ERC1155Transfer: { - toastTitle = qsTr("Sending %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.Swap: { - toastTitle = qsTr("Swapping %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Setting spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.CommunityDeployAssets: { - if (communityAmountInfinite1) { - toastTitle = qsTr("Minting infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Minting %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) - } - break - } - case Constants.SendType.CommunityDeployCollectibles: { - if (communityAmountInfinite1) { - toastTitle = qsTr("Minting infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Minting %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) - } - break - } - case Constants.SendType.CommunityDeployOwnerToken: { - toastTitle = qsTr("Minting %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunityMintTokens: { - if (!sentCommunityAmount2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdropping %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdropping %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) - } - } else if(communityInvolvedTokens === 2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdropping %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdropping %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + case Constants.txStatus.sending: { + toastTitle = qsTr("Sending %1 from %2 to %3") + toastLoading = true + + switch(txType) { + case Constants.SendType.Transfer: { + toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) + break } - } else { - toastTitle = qsTr("Airdropping %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) - } - break - } - case Constants.SendType.CommunityRemoteBurn: { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Destroying %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Destroying %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) - } - break - } - case Constants.SendType.CommunityBurn: { - toastTitle = qsTr("Burning %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunitySetSignerPubKey: { - toastTitle = qsTr("Finalizing ownership for %1 using %2").arg(communityName).arg(sender) - break - } - case Constants.SendType.Approve: { - console.warn("tx type approve not yet identified as a stand alone path") - break - } - default: - console.warn("status: sending - tx type not supproted") - return - } - break - } - case Constants.txStatus.pending: { - // So far we don't display notification when it's accepted by the network and its status is pending - // discussed in wallet group chat, we considered that pending status will be displayed almost at the - // same time as sending and decided to skip it. - return - } - case Constants.txStatus.success: { - toastTitle = qsTr("Sent %1 from %2 to %3") - toastIcon = "checkmark-circle" - toastType = Constants.ephemeralNotificationType.success - - switch(txType) { - case Constants.SendType.Transfer: { - toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) - break - } - case Constants.SendType.ENSRegister: { - toastTitle = qsTr("Registered %1 ENS name using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSRelease: { - toastTitle = qsTr("Released %1 ENS username using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSSetPubKey: { - toastTitle = qsTr("Set public key %1 using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.StickersBuy: { - toastTitle = qsTr("Purchased %1 sticker pack using %2").arg(stickersPackName).arg(sender) - break - } - case Constants.SendType.Bridge: { - toastTitle = qsTr("Bridged %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Spending spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.ERC721Transfer: { - toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.ERC1155Transfer: { - toastTitle = qsTr("Sent %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.Swap: { - toastTitle = qsTr("Swapped %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Spending cap set: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.CommunityDeployAssets: { - if (communityAmountInfinite1){ - toastTitle = qsTr("Minted infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Minted %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) - } - break - } - case Constants.SendType.CommunityDeployCollectibles: { - if (communityAmountInfinite1){ - toastTitle = qsTr("Minted infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Minted %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) - } - break - } - case Constants.SendType.CommunityDeployOwnerToken: { - toastTitle = qsTr("Minted %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunityMintTokens: { - if (!sentCommunityAmount2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdropped %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdropped %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) - } - } else if(communityInvolvedTokens === 2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdropped %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdropped %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + case Constants.SendType.ENSRegister: { + toastTitle = qsTr("Registering %1 ENS name using %2").arg(ensName).arg(sender) + break } - } else { - toastTitle = qsTr("Airdropped %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) - } - break - } - case Constants.SendType.CommunityRemoteBurn: { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Destroyed %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Destroyed %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + case Constants.SendType.ENSRelease: { + toastTitle = qsTr("Releasing %1 ENS username using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.ENSSetPubKey: { + toastTitle = qsTr("Setting public key %1 using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.StickersBuy: { + toastTitle = qsTr("Purchasing %1 sticker pack using %2").arg(stickersPackName).arg(sender) + break + } + case Constants.SendType.Bridge: { + toastTitle = qsTr("Bridging %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Setting spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.ERC721Transfer: { + toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.ERC1155Transfer: { + toastTitle = qsTr("Sending %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.Swap: { + toastTitle = qsTr("Swapping %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Setting spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.CommunityDeployAssets: { + if (communityAmountInfinite1) { + toastTitle = qsTr("Minting infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Minting %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployCollectibles: { + if (communityAmountInfinite1) { + toastTitle = qsTr("Minting infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Minting %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployOwnerToken: { + toastTitle = qsTr("Minting %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunityMintTokens: { + if (!sentCommunityAmount2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdropping %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdropping %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else if(communityInvolvedTokens === 2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdropping %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdropping %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else { + toastTitle = qsTr("Airdropping %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) + } + break + } + case Constants.SendType.CommunityRemoteBurn: { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Destroying %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Destroying %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + break + } + case Constants.SendType.CommunityBurn: { + toastTitle = qsTr("Burning %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunitySetSignerPubKey: { + toastTitle = qsTr("Finalizing ownership for %1 using %2").arg(communityName).arg(sender) + break + } + case Constants.SendType.Approve: { + console.warn("tx type approve not yet identified as a stand alone path") + break + } + default: + console.warn("status: sending - tx type not supproted") + return } break } - case Constants.SendType.CommunityBurn: { - toastTitle = qsTr("Burned %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunitySetSignerPubKey: { - toastTitle = qsTr("Finalized ownership for %1 using %2").arg(communityName).arg(sender) - break - } - case Constants.SendType.Approve: { - console.warn("tx type approve not yet identified as a stand alone path") - break - } - default: - console.warn("status: success - tx type not supproted") + case Constants.txStatus.pending: { + // So far we don't display notification when it's accepted by the network and its status is pending + // discussed in wallet group chat, we considered that pending status will be displayed almost at the + // same time as sending and decided to skip it. return } - break - } - case Constants.txStatus.failed: { - toastTitle = qsTr("Send failed: %1 from %2 to %3") - toastIcon = "warning" - toastType = Constants.ephemeralNotificationType.danger + case Constants.txStatus.success: { + toastTitle = qsTr("Sent %1 from %2 to %3") + toastIcon = "checkmark-circle" + toastType = Constants.ephemeralNotificationType.success - if (!toastSubtitle && !!error) { - toastSubtitle = error - } - - switch(txType) { - case Constants.SendType.Transfer: { - toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) - break - } - case Constants.SendType.ENSRegister: { - toastTitle = qsTr("ENS username registeration failed: %1 using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSRelease: { - toastTitle = qsTr("ENS username release failed: %1 using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.ENSSetPubKey: { - toastTitle = qsTr("Set public key failed: %1 using %2").arg(ensName).arg(sender) - break - } - case Constants.SendType.StickersBuy: { - toastTitle = qsTr("Sticker pack purchase failed: %1 using %2").arg(stickersPackName).arg(sender) - break - } - case Constants.SendType.Bridge: { - toastTitle = qsTr("Bridge failed: %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Spending spending failed: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.ERC721Transfer: { - toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.ERC1155Transfer: { - toastTitle = qsTr("Send failed: %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) - break - } - case Constants.SendType.Swap: { - toastTitle = qsTr("Swap failed: %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) - if (approvalTx) { - toastTitle = qsTr("Spending cap failed: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) - } - break - } - case Constants.SendType.CommunityDeployAssets: { - if (communityAmountInfinite1){ - toastTitle = qsTr("Mint failed: infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Mint failed: %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + switch(txType) { + case Constants.SendType.Transfer: { + toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) + break + } + case Constants.SendType.ENSRegister: { + toastTitle = qsTr("Registered %1 ENS name using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.ENSRelease: { + toastTitle = qsTr("Released %1 ENS username using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.ENSSetPubKey: { + toastTitle = qsTr("Set public key %1 using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.StickersBuy: { + toastTitle = qsTr("Purchased %1 sticker pack using %2").arg(stickersPackName).arg(sender) + break + } + case Constants.SendType.Bridge: { + toastTitle = qsTr("Bridged %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Spending spending cap: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.ERC721Transfer: { + toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.ERC1155Transfer: { + toastTitle = qsTr("Sent %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.Swap: { + toastTitle = qsTr("Swapped %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Spending cap set: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.CommunityDeployAssets: { + if (communityAmountInfinite1){ + toastTitle = qsTr("Minted infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Minted %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployCollectibles: { + if (communityAmountInfinite1){ + toastTitle = qsTr("Minted infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Minted %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployOwnerToken: { + toastTitle = qsTr("Minted %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunityMintTokens: { + if (!sentCommunityAmount2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdropped %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdropped %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else if(communityInvolvedTokens === 2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdropped %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdropped %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else { + toastTitle = qsTr("Airdropped %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) + } + break + } + case Constants.SendType.CommunityRemoteBurn: { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Destroyed %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Destroyed %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + break + } + case Constants.SendType.CommunityBurn: { + toastTitle = qsTr("Burned %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunitySetSignerPubKey: { + toastTitle = qsTr("Finalized ownership for %1 using %2").arg(communityName).arg(sender) + break + } + case Constants.SendType.Approve: { + console.warn("tx type approve not yet identified as a stand alone path") + break + } + default: + console.warn("status: success - tx type not supproted") + return } break } - case Constants.SendType.CommunityDeployCollectibles: { - if (communityAmountInfinite1){ - toastTitle = qsTr("Mint failed: infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) - } else { - toastTitle = qsTr("Mint failed: %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + case Constants.txStatus.failed: { + toastTitle = qsTr("Send failed: %1 from %2 to %3") + toastIcon = "warning" + toastType = Constants.ephemeralNotificationType.danger + + if (!toastSubtitle && !!error) { + toastSubtitle = error } - break - } - case Constants.SendType.CommunityDeployOwnerToken: { - toastTitle = qsTr("Mint failed: %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunityMintTokens: { - if (!sentCommunityAmount2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdrop failed: %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdrop failed: %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) - } - } else if(communityInvolvedTokens === 2) { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Airdrop failed: %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Airdrop failed: %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + + switch(txType) { + case Constants.SendType.Transfer: { + toastTitle = toastTitle.arg(sentAmount).arg(sender).arg(recipient) + break } - } else { - toastTitle = qsTr("Airdrop failed: %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) - } - break - } - case Constants.SendType.CommunityRemoteBurn: { - if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { - toastTitle = qsTr("Destruction failed: %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) - } else { - toastTitle = qsTr("Destruction failed: %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + case Constants.SendType.ENSRegister: { + toastTitle = qsTr("ENS username registeration failed: %1 using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.ENSRelease: { + toastTitle = qsTr("ENS username release failed: %1 using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.ENSSetPubKey: { + toastTitle = qsTr("Set public key failed: %1 using %2").arg(ensName).arg(sender) + break + } + case Constants.SendType.StickersBuy: { + toastTitle = qsTr("Sticker pack purchase failed: %1 using %2").arg(stickersPackName).arg(sender) + break + } + case Constants.SendType.Bridge: { + toastTitle = qsTr("Bridge failed: %1 from %2 to %3 in %4").arg(sentAmount).arg(senderChainName).arg(recipientChainName).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Spending spending failed: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.ERC721Transfer: { + toastTitle = toastTitle.arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.ERC1155Transfer: { + toastTitle = qsTr("Send failed: %1 %2 from %3 to %4").arg(fromAmount).arg(assetName).arg(sender).arg(recipient) + break + } + case Constants.SendType.Swap: { + toastTitle = qsTr("Swap failed: %1 to %2 in %3").arg(sentAmount).arg(receivedAmount).arg(sender) + if (approvalTx) { + toastTitle = qsTr("Spending cap failed: %1 in %2 for %3").arg(sentAmount).arg(sender).arg(txRecipient) + } + break + } + case Constants.SendType.CommunityDeployAssets: { + if (communityAmountInfinite1){ + toastTitle = qsTr("Mint failed: infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Mint failed: %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployCollectibles: { + if (communityAmountInfinite1){ + toastTitle = qsTr("Mint failed: infinite %1 tokens for %2 using %3").arg(communityDeployedTokenName).arg(communityName).arg(sender) + } else { + toastTitle = qsTr("Mint failed: %1 %2 tokens for %3 using %4").arg(sentCommunityAmount1).arg(communityDeployedTokenName).arg(communityName).arg(sender) + } + break + } + case Constants.SendType.CommunityDeployOwnerToken: { + toastTitle = qsTr("Mint failed: %1 and %2 tokens for %3 using %4").arg(communityOwnerTokenName).arg(communityMasterTokenName).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunityMintTokens: { + if (!sentCommunityAmount2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdrop failed: %1x %2 to %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdrop failed: %1x %2 to %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else if(communityInvolvedTokens === 2) { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Airdrop failed: %1x %2 and %3x %4 to %5 using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Airdrop failed: %1x %2 and %3x %4 to %5 addresses using %6").arg(sentCommunityAmount1).arg(communityAssetName1).arg(sentCommunityAmount2).arg(communityAssetName2).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + } else { + toastTitle = qsTr("Airdrop failed: %1 tokens to %2 using %3").arg(communityInvolvedTokens).arg(communityInvolvedAddress).arg(sender) + } + break + } + case Constants.SendType.CommunityRemoteBurn: { + if (communityNubmerOfInvolvedAddresses === 1 && !!communityInvolvedAddress) { + toastTitle = qsTr("Destruction failed: %1x %2 at %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityInvolvedAddress).arg(sender) + } else { + toastTitle = qsTr("Destruction failed: %1x %2 at %3 addresses using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityNubmerOfInvolvedAddresses).arg(sender) + } + break + } + case Constants.SendType.CommunityBurn: { + toastTitle = qsTr("Burn failed: %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) + break + } + case Constants.SendType.CommunitySetSignerPubKey: { + toastTitle = qsTr("Finalize ownership failed: %1 using %2").arg(communityName).arg(sender) + break + } + case Constants.SendType.Approve: { + console.warn("tx type approve not yet identified as a stand alone path") + break + } + default: + const err1 = "cannot_resolve_community" // move to Constants + if (error === err1) { + Global.displayToastMessage(qsTr("Unknown error resolving community"), "", "", false, Constants.ephemeralNotificationType.normal, "") + return + } + console.warn("status: failed - tx type not supproted") + return } break } - case Constants.SendType.CommunityBurn: { - toastTitle = qsTr("Burn failed: %1x %2 for %3 using %4").arg(sentCommunityAmount1).arg(communityAssetName1).arg(communityName).arg(sender) - break - } - case Constants.SendType.CommunitySetSignerPubKey: { - toastTitle = qsTr("Finalize ownership failed: %1 using %2").arg(communityName).arg(sender) - break - } - case Constants.SendType.Approve: { - console.warn("tx type approve not yet identified as a stand alone path") - break - } default: - const err1 = "cannot_resolve_community" // move to Constants - if (error === err1) { - Global.displayToastMessage(qsTr("Unknown error resolving community"), "", "", false, Constants.ephemeralNotificationType.normal, "") - return - } - console.warn("status: failed - tx type not supproted") - return - } - break - } - default: - if (!error) { - console.warn("not supported status") - return - } else { - const err1 = "cannot_resolve_community" // move to Constants - if (error === err1) { - Global.displayToastMessage(qsTr("Unknown error resolving community"), "", "", false, Constants.ephemeralNotificationType.normal, "") + if (!error) { + console.warn("not supported status") return + } else { + const err1 = "cannot_resolve_community" // move to Constants + if (error === err1) { + Global.displayToastMessage(qsTr("Unknown error resolving community"), "", "", false, Constants.ephemeralNotificationType.normal, "") + return + } } - } } Global.displayToastMessage(toastTitle, toastSubtitle, toastIcon, toastLoading, toastType, toastLink) @@ -827,7 +823,7 @@ Item { id: d readonly property int activeSectionType: appMain.rootStore.activeSectionType - readonly property bool isBrowserEnabled: appMain.featureFlagsStore.browserEnabled && localAccountSensitiveSettings.isBrowserEnabled + readonly property bool isBrowserEnabled: featureFlagsStore.browserEnabled && localAccountSensitiveSettings.isBrowserEnabled function openHomePage() { appMain.rootStore.setActiveSectionBySectionType(Constants.appSection.homePage) @@ -937,6 +933,7 @@ Item { rootChatStore: appMain.rootChatStore ensUsernamesStore: appMain.ensUsernamesStore privacyStore: appMain.privacyStore + keychain: appMain.keychain } @@ -1058,38 +1055,38 @@ Item { switch (state) { - case Constants.communityImported: - const community = appMain.communitiesStore.getCommunityDetailsAsJson(communityId) - if(community.isControlNode) { - title = qsTr("This device is now the control node for the %1 Community").arg(community.name) - notificationType = Constants.ephemeralNotificationType.success - icon = "checkmark-circle" - } else { - title = qsTr("'%1' community imported").arg(community.name) - } - break - case Constants.communityImportingInProgress: - title = qsTr("Importing community is in progress") - loading = true - break - case Constants.communityImportingError: - title = qsTr("Failed to import community '%1'").arg(communityId) - subTitle = errorMsg - break - case Constants.communityImportingCanceled: - title = qsTr("Import community '%1' was canceled").arg(community.name) - break; - default: - console.error("unknown state while importing community: %1").arg(state) - return + case Constants.communityImported: + const community = appMain.communitiesStore.getCommunityDetailsAsJson(communityId) + if(community.isControlNode) { + title = qsTr("This device is now the control node for the %1 Community").arg(community.name) + notificationType = Constants.ephemeralNotificationType.success + icon = "checkmark-circle" + } else { + title = qsTr("'%1' community imported").arg(community.name) + } + break + case Constants.communityImportingInProgress: + title = qsTr("Importing community is in progress") + loading = true + break + case Constants.communityImportingError: + title = qsTr("Failed to import community '%1'").arg(communityId) + subTitle = errorMsg + break + case Constants.communityImportingCanceled: + title = qsTr("Import community '%1' was canceled").arg(community.name) + break; + default: + console.error("unknown state while importing community: %1").arg(state) + return } Global.displayToastMessage(title, - subTitle, - icon, - loading, - notificationType, - "") + subTitle, + icon, + loading, + notificationType, + "") } } @@ -1118,7 +1115,7 @@ Item { onIsErrorChanged: { if(isError) { console.warn("Sound error:", - statusString) + statusString) } } } @@ -1133,7 +1130,7 @@ Item { onIsErrorChanged: { if(isError) { console.warn("Sound error:", - statusString) + statusString) } } } @@ -1148,7 +1145,7 @@ Item { onIsErrorChanged: { if(isError) { console.warn("Sound error:", - statusString) + statusString) } } } @@ -1201,7 +1198,7 @@ Item { onBuyClicked: popupRequestsHandler.sendModalHandler.buyStickerPack(packId, price) } } - + property Item navBar: StatusAppNavBar { visible: !homePageLoader.active width: visible ? implicitWidth : 0 @@ -1239,11 +1236,6 @@ Item { value: Constants.appSection.browser enabled: d.isBrowserEnabled } - ValueFilter { - roleName: "sectionType" - value: Constants.appSection.node - enabled: localAccountSensitiveSettings.nodeManagementEnabled - } }, ValueFilter { roleName: "enabled" @@ -1311,8 +1303,8 @@ Item { objectName: "invitePeople" onTriggered: { popups.openInviteFriendsToCommunityPopup(model, - communityContextMenu.chatCommunitySectionModule, - null) + communityContextMenu.chatCommunitySectionModule, + null) } } @@ -1381,7 +1373,7 @@ Item { icon.name: communityContextMenu.isSpectator ? "close-circle" : "arrow-left" type: StatusAction.Type.Danger onTriggered: communityContextMenu.isSpectator ? communityContextMenu.chatCommunitySectionModule.leaveCommunity() - : popups.openLeaveCommunityPopup(model.name, model.id, model.outroMessage) + : popups.openLeaveCommunityPopup(model.name, model.id, model.outroMessage) } } } @@ -1491,8 +1483,8 @@ Item { id: bannersLayout enabled: !localAppSettings.testEnvironment - && d.activeSectionType !== Constants.appSection.homePage - && !SQUtils.Utils.isMobile // Temp disable until we have proper way to handle banners on mobile + && d.activeSectionType !== Constants.appSection.homePage + && !SQUtils.Utils.isMobile // Temp disable until we have proper way to handle banners on mobile visible: enabled Layout.fillWidth: true @@ -1589,32 +1581,32 @@ Item { tooltipMessage: qsTr("Pocket Network (POKT) & Infura are currently both unavailable for %1. Balances for those chains are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) toastText: { switch(connectionState) { - case Constants.ConnectionStatus.Success: - return qsTr("Pocket Network (POKT) connection successful") - case Constants.ConnectionStatus.Failure: - if(completelyDown) { - if(withCache) - return qsTr("POKT & Infura down. Token balances are as of %1.").arg(lastCheckedAt) - else - return qsTr("POKT & Infura down. Token balances cannot be retrieved.") - } - else if(chainIdsDown.length > 0) { - if(chainIdsDown.length > 2) { - return qsTr("POKT & Infura down for multiple chains . Token balances for those chains cannot be retrieved.") - } - else if(chainIdsDown.length === 1 && withCache) { - return qsTr("POKT & Infura down for %1. %1 token balances are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) + case Constants.ConnectionStatus.Success: + return qsTr("Pocket Network (POKT) connection successful") + case Constants.ConnectionStatus.Failure: + if(completelyDown) { + if(withCache) + return qsTr("POKT & Infura down. Token balances are as of %1.").arg(lastCheckedAt) + else + return qsTr("POKT & Infura down. Token balances cannot be retrieved.") } - else { - return qsTr("POKT & Infura down for %1. %1 token balances cannot be retrieved.").arg(jointChainIdString) + else if(chainIdsDown.length > 0) { + if(chainIdsDown.length > 2) { + return qsTr("POKT & Infura down for multiple chains . Token balances for those chains cannot be retrieved.") + } + else if(chainIdsDown.length === 1 && withCache) { + return qsTr("POKT & Infura down for %1. %1 token balances are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) + } + else { + return qsTr("POKT & Infura down for %1. %1 token balances cannot be retrieved.").arg(jointChainIdString) + } } - } - else + else + return "" + case Constants.ConnectionStatus.Retrying: + return qsTr("Retrying connection to POKT Network (grove.city).") + default: return "" - case Constants.ConnectionStatus.Retrying: - return qsTr("Retrying connection to POKT Network (grove.city).") - default: - return "" } } } @@ -1634,41 +1626,41 @@ Item { } toastText: { switch(connectionState) { - case Constants.ConnectionStatus.Success: - return qsTr("Collectibles providers connection successful") - case Constants.ConnectionStatus.Failure: - if(completelyDown) { - if(withCache) - return qsTr("Collectibles providers down. Collectibles are as of %1.").arg(lastCheckedAt) - else - return qsTr("Collectibles providers down. Collectibles cannot be retrieved.") - } - else if(chainIdsDown.length > 0) { - if(chainIdsDown.length > 2) { - if(withCache) - return qsTr("Collectibles providers down for multiple chains. Collectibles for these chains are as of %1.".arg(lastCheckedAt)) - else - return qsTr("Collectibles providers down for multiple chains. Collectibles for these chains cannot be retrieved.") - } - else if(chainIdsDown.length === 1) { + case Constants.ConnectionStatus.Success: + return qsTr("Collectibles providers connection successful") + case Constants.ConnectionStatus.Failure: + if(completelyDown) { if(withCache) - return qsTr("Collectibles providers down for %1. Collectibles for this chain are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) + return qsTr("Collectibles providers down. Collectibles are as of %1.").arg(lastCheckedAt) else - return qsTr("Collectibles providers down for %1. Collectibles for this chain cannot be retrieved.").arg(jointChainIdString) + return qsTr("Collectibles providers down. Collectibles cannot be retrieved.") } - else { - if(withCache) - return qsTr("Collectibles providers down for %1. Collectibles for these chains are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) - else - return qsTr("Collectibles providers down for %1. Collectibles for these chains cannot be retrieved.").arg(jointChainIdString) + else if(chainIdsDown.length > 0) { + if(chainIdsDown.length > 2) { + if(withCache) + return qsTr("Collectibles providers down for multiple chains. Collectibles for these chains are as of %1.".arg(lastCheckedAt)) + else + return qsTr("Collectibles providers down for multiple chains. Collectibles for these chains cannot be retrieved.") + } + else if(chainIdsDown.length === 1) { + if(withCache) + return qsTr("Collectibles providers down for %1. Collectibles for this chain are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) + else + return qsTr("Collectibles providers down for %1. Collectibles for this chain cannot be retrieved.").arg(jointChainIdString) + } + else { + if(withCache) + return qsTr("Collectibles providers down for %1. Collectibles for these chains are as of %2.").arg(jointChainIdString).arg(lastCheckedAt) + else + return qsTr("Collectibles providers down for %1. Collectibles for these chains cannot be retrieved.").arg(jointChainIdString) + } } - } - else + else + return "" + case Constants.ConnectionStatus.Retrying: + return qsTr("Retrying connection to collectibles providers...") + default: return "" - case Constants.ConnectionStatus.Retrying: - return qsTr("Retrying connection to collectibles providers...") - default: - return "" } } } @@ -1682,20 +1674,20 @@ Item { networkConnectionStore: appMain.networkConnectionStore toastText: { switch(connectionState) { - case Constants.ConnectionStatus.Success: - return qsTr("CryptoCompare and CoinGecko connection successful") - case Constants.ConnectionStatus.Failure: { - if(withCache) { - return qsTr("CryptoCompare and CoinGecko down. Market values are as of %1.").arg(lastCheckedAt) - } - else { - return qsTr("CryptoCompare and CoinGecko down. Market values cannot be retrieved.") + case Constants.ConnectionStatus.Success: + return qsTr("CryptoCompare and CoinGecko connection successful") + case Constants.ConnectionStatus.Failure: { + if(withCache) { + return qsTr("CryptoCompare and CoinGecko down. Market values are as of %1.").arg(lastCheckedAt) + } + else { + return qsTr("CryptoCompare and CoinGecko down. Market values cannot be retrieved.") + } } - } - case Constants.ConnectionStatus.Retrying: - return qsTr("Retrying connection to CryptoCompare and CoinGecko...") - default: - return "" + case Constants.ConnectionStatus.Retrying: + return qsTr("Retrying connection to CryptoCompare and CoinGecko...") + default: + return "" } } } @@ -1711,38 +1703,38 @@ Item { currentIndex: { switch (d.activeSectionType) { - case Constants.appSection.homePage: - return Constants.appViewStackIndex.homePage - case Constants.appSection.chat: - return Constants.appViewStackIndex.chat - case Constants.appSection.community: - for (let i = this.children.length - 1; i >= 0; i--) { - var obj = this.children[i] - if (obj && obj.sectionId && obj.sectionId === appMain.rootStore.activeSectionId) { - return i + case Constants.appSection.homePage: + return Constants.appViewStackIndex.homePage + case Constants.appSection.chat: + return Constants.appViewStackIndex.chat + case Constants.appSection.community: + for (let i = this.children.length - 1; i >= 0; i--) { + var obj = this.children[i] + if (obj && obj.sectionId && obj.sectionId === appMain.rootStore.activeSectionId) { + return i + } } - } - // Should never be here, correct index must be returned from the for loop above - console.error("Wrong section type:", d.activeSectionType, - "or section id: ", appMain.rootStore.activeSectionId) - return Constants.appViewStackIndex.community - case Constants.appSection.communitiesPortal: - return Constants.appViewStackIndex.communitiesPortal - case Constants.appSection.wallet: - return Constants.appViewStackIndex.wallet - case Constants.appSection.profile: - return Constants.appViewStackIndex.profile - case Constants.appSection.browser: - return Constants.appViewStackIndex.browser - case Constants.appSection.node: - return Constants.appViewStackIndex.node - case Constants.appSection.market: - return Constants.appViewStackIndex.market - case Constants.appSection.activityCenter: - return Constants.appViewStackIndex.activityCenter - default: - // We should never end up here - console.error("AppMain: Unknown section type") + // Should never be here, correct index must be returned from the for loop above + console.error("Wrong section type:", d.activeSectionType, + "or section id: ", appMain.rootStore.activeSectionId) + return Constants.appViewStackIndex.community + case Constants.appSection.communitiesPortal: + return Constants.appViewStackIndex.communitiesPortal + case Constants.appSection.wallet: + return Constants.appViewStackIndex.wallet + case Constants.appSection.profile: + return Constants.appViewStackIndex.profile + case Constants.appSection.browser: + return Constants.appViewStackIndex.browser + case Constants.appSection.node: + return Constants.appViewStackIndex.node + case Constants.appSection.market: + return Constants.appViewStackIndex.market + case Constants.appSection.activityCenter: + return Constants.appViewStackIndex.activityCenter + default: + // We should never end up here + console.error("AppMain: Unknown section type") } } onCurrentIndexChanged: { @@ -1777,7 +1769,7 @@ Item { sectionsBaseModel: sectionsLoaded ? appMain.rootStore.sectionsModel : null chatsBaseModel: sectionsLoaded ? appMain.rootChatStore.chatSectionModuleModel - : null + : null chatsSearchBaseModel: sectionsLoaded && !!rootStore.chatSearchModel ? rootStore.chatSearchModel : null walletsBaseModel: sectionsLoaded ? WalletStores.RootStore.accounts : null dappsBaseModel: dAppsServiceLoader.active && dAppsServiceLoader.item ? dAppsServiceLoader.item.dappsModel : null @@ -1907,7 +1899,7 @@ Item { showUsersList: appMain.accountSettingsStore.showUsersList onShowUsersListRequested: - show => appMain.accountSettingsStore.setShowUsersList(show) + show => appMain.accountSettingsStore.setShowUsersList(show) isChatView: true navBar: appMain.navBar @@ -1931,7 +1923,7 @@ Item { stickersPopup: statusStickersPopupLoader.item sendViaPersonalChatEnabled: featureFlagsStore.sendViaPersonalChatEnabled disabledTooltipText: !appMain.networkConnectionStore.sendBuyBridgeEnabled ? - appMain.networkConnectionStore.sendBuyBridgeToolTipText : "" + appMain.networkConnectionStore.sendBuyBridgeToolTipText : "" paymentRequestFeatureEnabled: featureFlagsStore.paymentRequestEnabled mutualContactsModel: contactsModelAdaptor.mutualContacts @@ -2001,8 +1993,8 @@ Item { onOpenThirdpartyServicesInfoPopupRequested: popupRequestsHandler.thirdpartyServicesPopupHandler.openPopup() onOpenDiscussPageRequested: Global.openLinkWithConfirmation( - Constants.statusDiscussPageUrl, - SQUtils.StringUtils.extractDomainFromLink(Constants.statusDiscussPageUrl)) + Constants.statusDiscussPageUrl, + SQUtils.StringUtils.extractDomainFromLink(Constants.statusDiscussPageUrl)) } } @@ -2065,11 +2057,9 @@ Item { downloadsStore: BrowserStores.DownloadsStore {} browserRootStore: BrowserStores.BrowserRootStore {} browserWalletStore: BrowserStores.BrowserWalletStore {} + connectorController: WalletStores.RootStore.dappsConnectorController transactionStore: appMain.transactionStore - assetsStore: appMain.walletAssetsStore - currencyStore: appMain.currencyStore - tokensStore: appMain.tokensStore onSendToRecipientRequested: (address) => popupRequestsHandler.sendModalHandler.sendToRecipient(address) } } @@ -2150,8 +2140,8 @@ Item { onLeaveCommunityRequest: appMain.communitiesStore.leaveCommunity(communityId) onSetCommunityMutedRequest: appMain.communitiesStore.setCommunityMuted(communityId, mutedType) onInviteFriends: Global.openInviteFriendsToCommunityPopup(communityData, - appMain.communitiesStore.communitiesProfileModule, - null) + appMain.communitiesStore.communitiesProfileModule, + null) onOpenThirdpartyServicesInfoPopupRequested: popupRequestsHandler.thirdpartyServicesPopupHandler.openPopup() onOpenDiscussPageRequested: Global.openLinkWithConfirmation(Constants.statusDiscussPageUrl, SQUtils.StringUtils.extractDomainFromLink(Constants.statusDiscussPageUrl)) } @@ -2182,8 +2172,8 @@ Item { onOpenThirdpartyServicesInfoPopupRequested: popupRequestsHandler.thirdpartyServicesPopupHandler.openPopup() onOpenDiscussPageRequested: Global.openLinkWithConfirmation( - Constants.statusDiscussPageUrl, - SQUtils.StringUtils.extractDomainFromLink(Constants.statusDiscussPageUrl)) + Constants.statusDiscussPageUrl, + SQUtils.StringUtils.extractDomainFromLink(Constants.statusDiscussPageUrl)) } } @@ -2199,10 +2189,10 @@ Item { loading: appMain.marketStore.marketLeaderboardLoading currencySymbol: { const symbol = SQUtils.ModelUtils.getByKey( - appMain.currencyStore.currenciesModel, - "shortName", - appMain.currencyStore.currentCurrency, - "symbol") + appMain.currencyStore.currenciesModel, + "shortName", + appMain.currencyStore.currentCurrency, + "symbol") return !!symbol ? symbol: "" } fnFormatCurrencyAmount: function(amount, options) { @@ -2211,8 +2201,8 @@ Item { currentPage: appMain.marketStore.currentPage onRequestLaunchSwap: popupRequestsHandler.swapModalHandler.launchSwap() onFetchMarketTokens: (pageNumber, pageSize) => { - appMain.marketStore.requestMarketTokenPage(pageNumber, pageSize) - } + appMain.marketStore.requestMarketTokenPage(pageNumber, pageSize) + } } } @@ -2299,7 +2289,7 @@ Item { showUsersList: appMain.accountSettingsStore.showUsersList onShowUsersListRequested: - show => appMain.accountSettingsStore.setShowUsersList(show) + show => appMain.accountSettingsStore.setShowUsersList(show) isChatView: false // This will be a community view navBar: appMain.navBar @@ -2309,7 +2299,7 @@ Item { createChatPropertiesStore: appMain.createChatPropertiesStore communitiesStore: appMain.communitiesStore communitySettingsDisabled: !chatLayoutComponent.isManageCommunityEnabledInAdvanced && - (appMain.rootStore.isProduction && appMain.networksStore.areTestNetworksEnabled) + (appMain.rootStore.isProduction && appMain.networksStore.areTestNetworksEnabled) newCommnityStore: appMain.messagingRootStore.createCommunityRootStore(this, model.id) rootStore: ChatStores.RootStore { @@ -2371,7 +2361,7 @@ Item { property bool opened: false readonly property real defaultWidth: parent.width - Constants.chatSectionLeftColumnWidth - - anchors.rightMargin - anchors.leftMargin + anchors.rightMargin - anchors.leftMargin active: appMain.rootStore.sectionsLoaded && opened asynchronous: true @@ -2606,12 +2596,12 @@ Item { } Global.displayToastMessage(qsTr("An error occurred while %1 %2 address").arg(mode).arg(name), - "", - "warning", - false, - Constants.ephemeralNotificationType.danger, - "" - ) + "", + "warning", + false, + Constants.ephemeralNotificationType.danger, + "" + ) return } @@ -2620,12 +2610,12 @@ Item { msg = qsTr("%1 saved address successfully edited") } Global.displayToastMessage(msg.arg(name), - "", - "checkmark-circle", - false, - Constants.ephemeralNotificationType.success, - "" - ) + "", + "checkmark-circle", + false, + Constants.ephemeralNotificationType.success, + "" + ) } } @@ -2676,22 +2666,22 @@ Item { if (!!errorMsg) { Global.displayToastMessage(qsTr("An error occurred while removing %1 address").arg(name), - "", - "warning", - false, - Constants.ephemeralNotificationType.danger, - "" - ) + "", + "warning", + false, + Constants.ephemeralNotificationType.danger, + "" + ) return } Global.displayToastMessage(qsTr("%1 was successfully removed from your saved addresses").arg(name), - "", - "checkmark-circle", - false, - Constants.ephemeralNotificationType.success, - "" - ) + "", + "checkmark-circle", + false, + Constants.ephemeralNotificationType.success, + "" + ) } } } @@ -2705,11 +2695,11 @@ Item { property bool showForSavedAddress: false property var params property var selectedAccount: ({ - name: "", - address: "", - colorId: "", - emoji: "" - }) + name: "", + address: "", + colorId: "", + emoji: "" + }) function open(params = {}) { showQR.showSingleAccount = params.showSingleAccount?? false @@ -2933,7 +2923,7 @@ Item { onDisplayToastMessage: (message, type) => { const icon = type === Constants.ephemeralNotificationType.danger ? "warning" : - type === Constants.ephemeralNotificationType.success ? "checkmark-circle" : "info" + type === Constants.ephemeralNotificationType.success ? "checkmark-circle" : "info" Global.displayToastMessage(message, "", icon, false, type, "") } onPairingValidated: (validationState) => { @@ -2966,8 +2956,8 @@ Item { return const isAddress = SQUtils.ModelUtils.contains( - WalletStores.RootStore.accounts, "address", - text, Qt.CaseInsensitive) + WalletStores.RootStore.accounts, "address", + text, Qt.CaseInsensitive) if (isAddress) WalletStores.RootStore.addressWasShown(text) }