summaryrefslogtreecommitdiff
path: root/contents/ui/main.qml
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-04-07 15:42:13 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-04-07 15:42:13 +0800
commit07eb1dee4020bcf62f4295de07daa3acaba5ab7d (patch)
tree4f2d26777ecc87dc9efe81b912c3172bf0053296 /contents/ui/main.qml
parent5a280f20286e34319414881d84d4f024d95fc3da (diff)
Remove repeated config read
Diffstat (limited to 'contents/ui/main.qml')
-rw-r--r--contents/ui/main.qml12
1 files changed, 6 insertions, 6 deletions
diff --git a/contents/ui/main.qml b/contents/ui/main.qml
index bc49207..1c7d25f 100644
--- a/contents/ui/main.qml
+++ b/contents/ui/main.qml
@@ -55,6 +55,10 @@ Item {
let announcementCount = 0
let assignmentCount = 0
activityStream.forEach(activity => {
+ let important = plasmoid.configuration.importantActivities.includes(
+ activity.id.toString()
+ )
+
if (activity.type == "Announcement") {
announcementsModel.append({
type: "announcement",
@@ -63,9 +67,7 @@ Item {
course: course[1],
title: activity.title,
url: activity.html_url,
- important: plasmoid.configuration.importantActivities.includes(
- activity.id.toString()
- ),
+ important,
})
announcementCount++
} else if (activity.type == "Submission") {
@@ -77,9 +79,7 @@ Item {
title: activity.title,
due: activity.assignment.due_at,
url: activity.html_url,
- important: plasmoid.configuration.importantActivities.includes(
- activity.id.toString()
- ),
+ important,
})
assignmentCount++
}