mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 14:54:48 +00:00
423882df89
I noticed that the 1:1 chat commands were not able to send token transactions due to "intrinsic gas too low" error. I quickly realised there there were a few components missing, which have been fixed. *feat: update the 1:1 chat commands transaction modal to allow editing of the from account and network fee* The TransactionStackGroup was updated slightly to allow manual control of back/next actions. Fixes #870. *fix: Create distinct modal transaction actions* Previously, adding `Connection`s for the `walletModel.transactionWasSent` signal in different dialogs would cause the signal to be handled in the wrong dialog. The solution was to pass a `uuid` from the requesting dialog, and include the `uuid` in the response, so that only requests that were requested from the dialog would be handled. *fix: update 1:1 translations* All the translations were not being translated for me. I noticed that they did not exist in the `.ts` translation files either.
77 lines
1.8 KiB
QML
77 lines
1.8 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
import "../imports"
|
|
|
|
StackView {
|
|
id: root
|
|
default property list<FormGroup> groups
|
|
property int currentIdx: 0
|
|
property bool isLastGroup: currentIdx === groups.length - 1
|
|
property bool isFirstGroup: currentIdx === 0
|
|
signal groupActivated(Item group)
|
|
property alias currentGroup: root.currentItem
|
|
readonly property string uuid: Utils.uuid()
|
|
|
|
property var next: function() {
|
|
if (groups && groups.length <= currentIdx + 1) {
|
|
return
|
|
}
|
|
const group = groups[++currentIdx]
|
|
this.push(group, StackView.Immediate)
|
|
}
|
|
property var back: function() {
|
|
if (currentIdx <= 0) {
|
|
return
|
|
}
|
|
this.pop()
|
|
currentIdx--
|
|
}
|
|
|
|
function reset() {
|
|
for (let i=0; i<groups.length; i++) {
|
|
groups[i].reset()
|
|
}
|
|
this.pop(null)
|
|
currentIdx = 0
|
|
}
|
|
|
|
initialItem: groups[currentIdx]
|
|
anchors.fill: parent
|
|
|
|
// The below transitions are pointless, but without them,
|
|
// the final input in the final TransactionFormGroup will
|
|
// not be able to receive focus! Seems like a Qt bug...
|
|
pushEnter: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
pushExit: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
popEnter: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
popExit: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
}
|