diff options
author | Frederick Yin <fkfd@fkfd.me> | 2023-07-29 21:19:22 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2023-07-29 21:19:22 +0800 |
commit | dacaf4de37c3749c44ca16c7d609ac6977e6bb49 (patch) | |
tree | 46db693b55904b330ed8e881be0b6d0e772d9bee /contents/ui/ActivityView.qml | |
parent | 3d6239a9288d091f0a365e775365e8fa033db822 (diff) |
Fix dynamic typing bug
Diffstat (limited to 'contents/ui/ActivityView.qml')
-rw-r--r-- | contents/ui/ActivityView.qml | 19 |
1 files 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 |