From 07eb1dee4020bcf62f4295de07daa3acaba5ab7d Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 7 Apr 2022 15:42:13 +0800 Subject: Remove repeated config read --- contents/ui/main.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'contents/ui/main.qml') 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++ } -- cgit v1.2.3