Move PasswordStatus out of Controller

This commit is contained in:
Tobias Fella
2023-12-02 21:04:23 +01:00
parent 65c892787e
commit 0521ff2c4d
5 changed files with 28 additions and 25 deletions

View File

@@ -215,4 +215,17 @@ FormCard.FormCardPage {
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ConfirmDeactivateAccountDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Confirm Deactivating Account")})
}
}
data: Connections {
target: root.connection
function onPasswordStatus(status) {
if (status === NeoChatConnection.Success) {
showPassiveNotification(i18n("Password changed successfully"));
} else if (status === NeoChatConnection.Wrong) {
showPassiveNotification(i18n("Wrong password entered"));
} else {
showPassiveNotification(i18n("Unknown problem while trying to change password"));
}
}
}
}

View File

@@ -110,14 +110,5 @@ FormCard.FormCardPage {
pageStack.layers.pop()
}
}
function onPasswordStatus(status) {
if (status === Controller.Success) {
showPassiveNotification(i18n("Password changed successfully"));
} else if (status === Controller.Wrong) {
showPassiveNotification(i18n("Wrong password entered"));
} else {
showPassiveNotification(i18n("Unknown problem while trying to change password"));
}
}
}
}