From 4eaba191de4fc1ae1709b90c97ec4030397f1d7c Mon Sep 17 00:00:00 2001 From: NepNep21 <43792621+NepNep21@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:10:04 -0300 Subject: Use properties --- resources/qml/dialogs/IgnoredUsers.qml | 13 ++++--------- resources/qml/dialogs/UserProfile.qml | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'resources') diff --git a/resources/qml/dialogs/IgnoredUsers.qml b/resources/qml/dialogs/IgnoredUsers.qml index 65574338..bdd24a57 100644 --- a/resources/qml/dialogs/IgnoredUsers.qml +++ b/resources/qml/dialogs/IgnoredUsers.qml @@ -10,7 +10,6 @@ import im.nheko 1.0 Window { id: ignoredUsers - required property list users required property var profile title: qsTr("Ignored users") @@ -22,13 +21,9 @@ Window { Connections { target: profile - function onUnignoredUser(id, err) { - if (err) { - const text = qsTr("Failed to unignore \"%1\": %2").arg(id).arg(err) - MainWindow.showNotification(text) - } else { - users = Array.from(users).filter(user => user !== id) - } + function onUnignoredUserError(id, err) { + const text = qsTr("Failed to unignore \"%1\": %2").arg(id).arg(err) + MainWindow.showNotification(text) } } @@ -37,7 +32,7 @@ Window { anchors.fill: parent spacing: Nheko.paddingMedium - model: users + model: TimelineManager.ignoredUsers header: ColumnLayout { Text { Layout.fillWidth: true diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index 4df27a3f..3d65d52a 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -322,7 +322,7 @@ ApplicationWindow { onClicked: { var component = Qt.createComponent("IgnoredUsers.qml") if (component.status == Component.Ready) { - var window = component.createObject(userProfileDialog, {users: profile.getIgnoredUsers(), profile: profile}) + var window = component.createObject(userProfileDialog, { profile: profile}) window.show() timelineRoot.destroyOnClose(window) } else { -- cgit 1.4.1