You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was loosing my hair because Google Analytics was listening 2 times to all my events... but I ended up finding that's cookieLaw component that triggers the @accept='...' listener even if no click happened.
I mean:
I'm new user, the cookie consent pops up
I accept it by clicking, the @accept is triggered
If I refresh my page
the @accept is also triggered immediately since I guess the component detects it has been accepted in the past (thanks to local storage)
I thought it would just trigger @accept when there is a click, and in other case (initialization...), we wait for the component to be ready, and we use isAccepted(), no?
However, I would consider this rather a bug. Because you are right, the accept event should be only emitted on action.
I will rename the mounted one to accepted so you have one event that gets emitted on component mounting and one on action. Because I think it is good to have one evenet that will tell you early on if a user accepted cookies previously. Especially if you are not using scoped slots, just the simple version.
vue & vue-cookie-law version
1.13.3
Hi,
I was loosing my hair because Google Analytics was listening 2 times to all my events... but I ended up finding that's cookieLaw component that triggers the
@accept='...'
listener even if no click happened.I mean:
@accept
is triggered@accept
is also triggered immediately since I guess the component detects it has been accepted in the past (thanks to local storage)I thought it would just trigger
@accept
when there is a click, and in other case (initialization...), we wait for the component to be ready, and we useisAccepted()
, no?Thank you,
cc @apertureless
EDIT:
If that's the wanted behavior, it would be great to mention it in the docs https://github.com/apertureless/vue-cookie-law#events
The text was updated successfully, but these errors were encountered: