Skip to content

Commit 73c35b7

Browse files
fix(@desktop/browser): after disconnecting my wallet from Opensea the browser bar UI got messed up
fixes #19352
1 parent 395c3ca commit 73c35b7

File tree

11 files changed

+9
-96
lines changed

11 files changed

+9
-96
lines changed

storybook/pages/BrowserLayoutPage.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Item {
5151
}
5252
}
5353
browserRootStore: BrowserStores.BrowserRootStore {
54-
property bool currentTabConnected
5554
property var urlENSDictionary: ({})
5655

5756
function get0xFormedUrl(browserExplorer, url) {

ui/app/AppLayouts/Browser/BrowserLayout.qml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ StatusSectionLayout {
225225
isLoading: (!!_internal.currentWebView && _internal.currentWebView.loading)
226226
canGoBack: (!!_internal.currentWebView && _internal.currentWebView.canGoBack)
227227
canGoForward: (!!_internal.currentWebView && _internal.currentWebView.canGoForward)
228-
currentTabConnected: root.browserRootStore.currentTabConnected
229228
browserDappsModel: browserDappsProvider.model
230229
browserDappsCount: browserDappsProvider.model ? browserDappsProvider.model.count : 0
231230
onOpenHistoryPopup: (xPos, yPos) => historyMenu.popup(xPos, yPos)
@@ -425,7 +424,6 @@ StatusSectionLayout {
425424
Component {
426425
id: browserWalletMenu
427426
BrowserWalletMenu {
428-
currentTabConnected: root.browserRootStore.currentTabConnected
429427
browserWalletStore: root.browserWalletStore
430428
property point headerPoint: Qt.point(browserHeader.x, browserHeader.y)
431429
x: (parent.width - width - Theme.halfPadding)
@@ -438,11 +436,6 @@ StatusSectionLayout {
438436
tabs.getTab(i).reload();
439437
}
440438
}
441-
onDisconnect: {
442-
connectorBridge.disconnectCurrentTab()
443-
_internal.currentWebView.reload()
444-
close()
445-
}
446439
}
447440
}
448441
}
@@ -614,18 +607,6 @@ StatusSectionLayout {
614607
target: _internal.currentWebView
615608
function onUrlChanged() {
616609
browserHeader.addressBar.text = root.browserRootStore.obtainAddress(_internal.currentWebView.url)
617-
618-
if (_internal.currentWebView && _internal.currentWebView.url) {
619-
const urlStr = _internal.currentWebView.url.toString()
620-
const hostname = Utils.getHostname(urlStr)
621-
622-
root.browserRootStore.currentTabConnected = connectorBridge.hasWalletConnected(
623-
hostname,
624-
root.browserWalletStore.dappBrowserAccount.address
625-
)
626-
} else {
627-
root.browserRootStore.currentTabConnected = false
628-
}
629610

630611
// Update ConnectorBridge with current dApp metadata
631612
if (_internal.currentWebView && _internal.currentWebView.url) {

ui/app/AppLayouts/Browser/panels/BrowserHeader.qml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Rectangle {
2525
property bool canGoBack: false
2626
property bool canGoForward: false
2727
property var currentFavorite
28-
property bool currentTabConnected: false
2928
property string dappBrowserAccName: ""
3029
property string dappBrowserAccIcon: ""
3130
property var settingMenu
@@ -191,13 +190,12 @@ Rectangle {
191190
Layout.preferredWidth: _internal.buttonSize
192191
Layout.preferredHeight: _internal.buttonSize
193192
active: true
194-
sourceComponent: currentTabConnected ? connectedBtnComponent : notConnectedBtnCompoent
193+
sourceComponent: accountBtnCompoent
195194
}
196195

197196
Component {
198-
id: notConnectedBtnCompoent
197+
id: accountBtnCompoent
199198
StatusFlatRoundButton {
200-
id: accountBtn
201199
icon.name: "filled-account"
202200
type: StatusFlatRoundButton.Type.Tertiary
203201
onPressed: {
@@ -206,19 +204,6 @@ Rectangle {
206204
}
207205
}
208206

209-
Component {
210-
id: connectedBtnComponent
211-
StatusFlatButton {
212-
id: accountBtnConnected
213-
icon.name: "wallet"
214-
icon.color: dappBrowserAccIcon
215-
text: dappBrowserAccName
216-
onPressed: {
217-
root.openWalletMenu();
218-
}
219-
}
220-
}
221-
222207
StatusFlatRoundButton {
223208
id: settingsMenuButton
224209
Layout.preferredHeight: _internal.buttonSize

ui/app/AppLayouts/Browser/popups/BrowserConnectionModal.qml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ StatusModal {
3636
function postMessage(isAllowed){
3737
console.log(isAllowed)
3838
interactedWith = true
39-
root.browserRootStore.currentTabConnected = isAllowed
4039
if(isAllowed){
4140
dappPermissionsModule.addPermission(request.hostname, request.address, request.permission)
4241
}
@@ -45,7 +44,6 @@ StatusModal {
4544

4645
onClosed: {
4746
if(!interactedWith){
48-
root.browserRootStore.currentTabConnected = false
4947
postMessage(false);
5048
}
5149
}

ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ import AppLayouts.Browser.stores as BrowserStores
1818
Dialog {
1919
id: root
2020

21-
required property bool currentTabConnected
2221
required property BrowserStores.BrowserWalletStore browserWalletStore
2322

2423
signal sendTriggered(string address)
25-
signal disconnect()
2624
signal reload()
2725
signal accountChanged(string newAddress)
2826

@@ -56,7 +54,7 @@ Dialog {
5654
Item {
5755
id: walletHeader
5856
width: parent.width
59-
height: disconnectBtn.height
57+
height: childrenRect.height
6058

6159
// TODO: Uncomment and connect to connector in next PR
6260
// Network indicator showing current chain
@@ -96,21 +94,6 @@ Dialog {
9694
font.pixelSize: 13
9795
}
9896
*/
99-
100-
StatusBaseText {
101-
id: disconnectBtn
102-
text: qsTr("Disconnect")
103-
anchors.verticalCenter: parent.verticalCenter
104-
anchors.right: parent.right
105-
color: Theme.palette.dangerColor1
106-
visible: root.currentTabConnected
107-
108-
MouseArea {
109-
cursorShape: Qt.PointingHandCursor
110-
anchors.fill: parent
111-
onClicked: disconnect()
112-
}
113-
}
11497
}
11598

11699

ui/app/AppLayouts/Browser/stores/BrowserRootStore.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import utils
77
QtObject {
88
id: root
99

10-
property bool currentTabConnected: false
1110
property var urlENSDictionary: ({})
1211

1312
function getAscii2Hex(input) {

ui/i18n/qml_base_en.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,13 +2705,6 @@ Do you wish to override the security check and continue?</source>
27052705
<translation type="unfinished"></translation>
27062706
</message>
27072707
</context>
2708-
<context>
2709-
<name>BrowserWalletMenu</name>
2710-
<message>
2711-
<source>Disconnect</source>
2712-
<translation type="unfinished"></translation>
2713-
</message>
2714-
</context>
27152708
<context>
27162709
<name>BrowserWebEngineView</name>
27172710
<message>
@@ -15160,6 +15153,7 @@ to load</source>
1516015153
</message>
1516115154
<message>
1516215155
<source>%1 to %2</source>
15156+
<extracomment>e.g. (Send) 100 DAI to batista.eth</extracomment>
1516315157
<translation type="unfinished"></translation>
1516415158
</message>
1516515159
<message>

ui/i18n/qml_base_lokalise_en.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,14 +3312,6 @@
33123312
<translation>Search engine for address bar</translation>
33133313
</message>
33143314
</context>
3315-
<context>
3316-
<name>BrowserWalletMenu</name>
3317-
<message>
3318-
<source>Disconnect</source>
3319-
<comment>BrowserWalletMenu</comment>
3320-
<translation>Disconnect</translation>
3321-
</message>
3322-
</context>
33233315
<context>
33243316
<name>BrowserWebEngineView</name>
33253317
<message>

ui/i18n/qml_cs.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,13 +2712,6 @@ Do you wish to override the security check and continue?</source>
27122712
<translation type="unfinished"></translation>
27132713
</message>
27142714
</context>
2715-
<context>
2716-
<name>BrowserWalletMenu</name>
2717-
<message>
2718-
<source>Disconnect</source>
2719-
<translation type="unfinished"></translation>
2720-
</message>
2721-
</context>
27222715
<context>
27232716
<name>BrowserWebEngineView</name>
27242717
<message>
@@ -15224,6 +15217,7 @@ to load</source>
1522415217
</message>
1522515218
<message>
1522615219
<source>%1 to %2</source>
15220+
<extracomment>e.g. (Send) 100 DAI to batista.eth</extracomment>
1522715221
<translation type="unfinished"></translation>
1522815222
</message>
1522915223
<message>

ui/i18n/qml_es.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,7 +2604,7 @@ Para respaldar tu frase de recuperación, escríbela y guárdala de forma segura
26042604
<name>BrowserHeader</name>
26052605
<message>
26062606
<source>Enter URL</source>
2607-
<translation>Ingresa una URL</translation>
2607+
<translation type="unfinished"></translation>
26082608
</message>
26092609
</context>
26102610
<context>
@@ -2709,13 +2709,6 @@ Do you wish to override the security check and continue?</source>
27092709
<translation>Mostrar barra de favoritos</translation>
27102710
</message>
27112711
</context>
2712-
<context>
2713-
<name>BrowserWalletMenu</name>
2714-
<message>
2715-
<source>Disconnect</source>
2716-
<translation>Desconectar</translation>
2717-
</message>
2718-
</context>
27192712
<context>
27202713
<name>BrowserWebEngineView</name>
27212714
<message>
@@ -15183,6 +15176,7 @@ al cargar</translation>
1518315176
</message>
1518415177
<message>
1518515178
<source>%1 to %2</source>
15179+
<extracomment>e.g. (Send) 100 DAI to batista.eth</extracomment>
1518615180
<translation>%1 a %2</translation>
1518715181
</message>
1518815182
<message>

0 commit comments

Comments
 (0)