summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNepNep21 <43792621+NepNep21@users.noreply.github.com>2023-09-07 18:10:04 -0300
committerNepNep21 <43792621+NepNep21@users.noreply.github.com>2023-10-01 22:52:40 -0300
commit4eaba191de4fc1ae1709b90c97ec4030397f1d7c (patch)
tree4b40a0bff1104132ade714cade91e89466796b8e /resources/qml
parentMove comments to proper reviews (diff)
downloadnheko-4eaba191de4fc1ae1709b90c97ec4030397f1d7c.tar.xz
Use properties
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/dialogs/IgnoredUsers.qml13
-rw-r--r--resources/qml/dialogs/UserProfile.qml2
2 files changed, 5 insertions, 10 deletions
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<string> 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 {