From dacaf4de37c3749c44ca16c7d609ac6977e6bb49 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sat, 29 Jul 2023 21:19:22 +0800 Subject: Fix dynamic typing bug --- contents/ui/ActivityView.qml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/contents/ui/ActivityView.qml b/contents/ui/ActivityView.qml index 4b32cf4..3484eed 100644 --- a/contents/ui/ActivityView.qml +++ b/contents/ui/ActivityView.qml @@ -40,14 +40,15 @@ PlasmaComponents.ListItem { } let finishedActivities = plasmoid.configuration[configKeys[type]] + const activityIdStr = activityId.toString() if (finished) { - if (!finishedActivities.includes(activityId)) { - finishedActivities.push(activityId) + if (!finishedActivities.includes(activityIdStr)) { + finishedActivities.push(activityIdStr) } } else { - // remove activityId from list + // remove activityIdStr from list finishedActivities.splice( - finishedActivities.indexOf(activityId), 1 + finishedActivities.indexOf(activityIdStr), 1 ) } // save config @@ -112,14 +113,16 @@ PlasmaComponents.ListItem { } let importantActivities = plasmoid.configuration[configKeys[type]] + const activityIdStr = activityId.toString() + if (important) { - if (!importantActivities.includes(activityId)) { - importantActivities.push(activityId) + if (!importantActivities.includes(activityIdStr)) { + importantActivities.push(activityIdStr) } } else { - // remove activityId from list + // remove activityIdStr from list importantActivities.splice( - importantActivities.indexOf(activityId), 1 + importantActivities.indexOf(activityIdStr), 1 ) } // save config -- cgit v1.2.3