fix(ui): allow unreacting from comment popover
- fix selectors for hasReacted - don't send empty HTML on reaction errors - add E2E test
This commit is contained in:
parent
633406704c
commit
b8a5ca2c40
3 changed files with 80 additions and 27 deletions
|
@ -9,7 +9,7 @@ export function initCompReactionSelector($parent) {
|
|||
|
||||
const actionUrl = this.closest('[data-action-url]')?.getAttribute('data-action-url');
|
||||
const reactionContent = this.getAttribute('data-reaction-content');
|
||||
const hasReacted = this.closest('.ui.segment.reactions')?.querySelector(`a[data-reaction-content="${reactionContent}"]`)?.getAttribute('data-has-reacted') === 'true';
|
||||
const hasReacted = this.closest('.comment')?.querySelector(`.ui.segment.reactions a[data-reaction-content="${reactionContent}"]`)?.getAttribute('data-has-reacted') === 'true';
|
||||
|
||||
const res = await POST(`${actionUrl}/${hasReacted ? 'unreact' : 'react'}`, {
|
||||
data: new URLSearchParams({content: reactionContent}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue