mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-27 14:01:19 +00:00
fix(@desktop/browser): Clicking on add buttons adds the same button twice
fixes #4280
This commit is contained in:
parent
d5a3ead0b6
commit
f41ed8a522
@ -238,13 +238,13 @@ Rectangle {
|
|||||||
onReload: _internal.currentWebView.reload()
|
onReload: _internal.currentWebView.reload()
|
||||||
onStopLoading: _internal.currentWebView.stop()
|
onStopLoading: _internal.currentWebView.stop()
|
||||||
onAddNewFavoritelClicked: {
|
onAddNewFavoritelClicked: {
|
||||||
addFavoriteModal.modifiyModal = browserHeader.currentFavorite
|
Global.openPopup(addFavoriteModal, {
|
||||||
addFavoriteModal.toolbarMode = true
|
x = xPos - 30,
|
||||||
addFavoriteModal.x = xPos - 30
|
y = browserHeader.y + browserHeader.height + 4,
|
||||||
addFavoriteModal.y = browserHeader.y + browserHeader.height + 4
|
modifiyModal: browserHeader.currentFavorite,
|
||||||
addFavoriteModal.ogUrl = browserHeader.currentFavorite ? browserHeader.currentFavorite.url : _internal.currentWebView.url
|
toolbarMode: true,
|
||||||
addFavoriteModal.ogName = browserHeader.currentFavorite ? browserHeader.currentFavorite.name : _internal.currentWebView.title
|
ogUrl: browserHeader.currentFavorite ? browserHeader.currentFavorite.url : _internal.currentWebView.url,
|
||||||
addFavoriteModal.open()
|
ogName: browserHeader.currentFavorite ? browserHeader.currentFavorite.name : _internal.currentWebView.title})
|
||||||
}
|
}
|
||||||
onLaunchInBrowser: {
|
onLaunchInBrowser: {
|
||||||
// TODO: disable browsing local files? file://
|
// TODO: disable browsing local files? file://
|
||||||
@ -315,8 +315,9 @@ Rectangle {
|
|||||||
z: 100
|
z: 100
|
||||||
}
|
}
|
||||||
|
|
||||||
AddFavoriteModal {
|
Component {
|
||||||
id: addFavoriteModal
|
id: addFavoriteModal
|
||||||
|
AddFavoriteModal {}
|
||||||
}
|
}
|
||||||
|
|
||||||
FavoriteMenu {
|
FavoriteMenu {
|
||||||
@ -324,11 +325,11 @@ Rectangle {
|
|||||||
openInNewTab: function (url) {
|
openInNewTab: function (url) {
|
||||||
browserWindow.openUrlInNewTab(url)
|
browserWindow.openUrlInNewTab(url)
|
||||||
}
|
}
|
||||||
onEditFavoriteTriggered: {
|
onEditFavoriteTriggered: {
|
||||||
addFavoriteModal.modifiyModal = true
|
Global.openPopup(addFavoriteModal, {
|
||||||
addFavoriteModal.ogUrl = favoriteMenu.currentFavorite ? favoriteMenu.currentFavorite.url : _internal.currentWebView.url
|
modifiyModal: true,
|
||||||
addFavoriteModal.ogName = favoriteMenu.currentFavorite ? favoriteMenu.currentFavorite.name : _internal.currentWebView.title
|
ogUrl: favoriteMenu.currentFavorite ? favoriteMenu.currentFavorite.url : _internal.currentWebView.url,
|
||||||
addFavoriteModal.open()
|
ogName: favoriteMenu.currentFavorite ? favoriteMenu.currentFavorite.name : _internal.currentWebView.title})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,10 +526,9 @@ Rectangle {
|
|||||||
_internal.currentWebView.url = _internal.determineRealURL(url)
|
_internal.currentWebView.url = _internal.determineRealURL(url)
|
||||||
}
|
}
|
||||||
addFavModal: function() {
|
addFavModal: function() {
|
||||||
addFavoriteModal.toolbarMode = true
|
Global.openPopup(addFavoriteModal, {toolbarMode: true,
|
||||||
addFavoriteModal.ogUrl = browserHeader.currentFavorite ? browserHeader.currentFavorite.url : _internal.currentWebView.url
|
ogUrl: browserHeader.currentFavorite ? browserHeader.currentFavorite.url : _internal.currentWebView.url,
|
||||||
addFavoriteModal.ogName = browserHeader.currentFavorite ? browserHeader.currentFavorite.name : _internal.currentWebView.title
|
ogName: browserHeader.currentFavorite ? browserHeader.currentFavorite.name : _internal.currentWebView.title})
|
||||||
addFavoriteModal.open()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ GridView {
|
|||||||
webUrl: determineRealURLFn(url)
|
webUrl: determineRealURLFn(url)
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!webUrl.toString()) {
|
if (!webUrl.toString()) {
|
||||||
addFavModal.open()
|
Global.openPopup(addFavModal)
|
||||||
} else {
|
} else {
|
||||||
setAsCurrentWebUrl(webUrl)
|
setAsCurrentWebUrl(webUrl)
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ import "../stores"
|
|||||||
|
|
||||||
// TODO: replace with StatusModal
|
// TODO: replace with StatusModal
|
||||||
ModalPopup {
|
ModalPopup {
|
||||||
property string ogUrl
|
property string ogUrl: ""
|
||||||
property string ogName
|
property string ogName: ""
|
||||||
property bool modifiyModal: false
|
property bool modifiyModal: false
|
||||||
property bool toolbarMode: false
|
property bool toolbarMode: false
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ ModalPopup {
|
|||||||
//% "Add"
|
//% "Add"
|
||||||
qsTrId("add")
|
qsTrId("add")
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
enabled: nameInput.valid && urlInput.valid
|
enabled: nameInput.valid && !!nameInput.text && urlInput.valid && !!urlInput.text
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!popup.modifiyModal) {
|
if (!popup.modifiyModal) {
|
||||||
// remove "add favorite" button at the end, add new bookmark, add "add favorite" button back
|
// remove "add favorite" button at the end, add new bookmark, add "add favorite" button back
|
||||||
|
Loading…
x
Reference in New Issue
Block a user