diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-04-07 15:42:13 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-04-07 15:42:13 +0800 |
commit | 07eb1dee4020bcf62f4295de07daa3acaba5ab7d (patch) | |
tree | 4f2d26777ecc87dc9efe81b912c3172bf0053296 /contents | |
parent | 5a280f20286e34319414881d84d4f024d95fc3da (diff) |
Remove repeated config read
Diffstat (limited to 'contents')
-rw-r--r-- | contents/ui/main.qml | 12 |
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++ } |