File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ = 1.6.1 =
2+
3+ Bugs we fixed:
4+
5+ * "Collect your point" not closing the "Test if your website can send emails correctly" popover.
6+
17= 1.6.0 =
28
39Enhancements:
Original file line number Diff line number Diff line change 1- /* global HTMLElement */
1+ /* global HTMLElement, prplSuggestedTask */
22
33/**
44 * Register the custom web component.
@@ -73,17 +73,22 @@ class PrplInteractiveTask extends HTMLElement {
7373 */
7474 completeTask ( ) {
7575 const providerId = this . getAttribute ( 'provider-id' ) ;
76- const components = document . querySelectorAll ( 'prpl-suggested-task' ) ;
76+ const tasks = document . querySelectorAll (
77+ '#prpl-suggested-tasks-list .prpl-suggested-task'
78+ ) ;
7779
78- components . forEach ( ( component ) => {
79- const liElement = component . querySelector ( 'li' ) ;
80- if ( liElement . dataset . taskId === providerId ) {
80+ tasks . forEach ( ( taskElement ) => {
81+ if ( taskElement . dataset . taskId === providerId ) {
8182 // Close popover.
8283 document
8384 . getElementById ( 'prpl-popover-' + providerId )
8485 . hidePopover ( ) ;
85- // Complete task.
86- component . runTaskAction ( liElement . dataset . taskId , 'complete' ) ;
86+
87+ const postId = parseInt ( taskElement . dataset . postId ) ;
88+
89+ if ( postId ) {
90+ prplSuggestedTask . maybeComplete ( postId ) ;
91+ }
8792 }
8893 } ) ;
8994 }
You can’t perform that action at this time.
0 commit comments