Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force run onSiteChange first time #307

Merged
merged 2 commits into from Apr 7, 2021
Merged

force run onSiteChange first time #307

merged 2 commits into from Apr 7, 2021

Conversation

flamisz
Copy link
Contributor

@flamisz flamisz commented Mar 22, 2021

@flamisz
Copy link
Contributor Author

flamisz commented Apr 6, 2021

@tsteur, @diosmosis already merged this PR.
This is connected to that one, because the tag manager containers are not loading onto the page without this. Can you please you or @sgiehl check it?

@diosmosis
Copy link
Member

I'm not super familiar w/ the tag manager, but the code looks good to me

@sgiehl
Copy link
Member

sgiehl commented Apr 6, 2021

@flamisz could you maybe describe a bit clearer what "bug" this should fix?

@flamisz
Copy link
Contributor Author

flamisz commented Apr 6, 2021

@flamisz could you maybe describe a bit clearer what "bug" this should fix?

@sgiehl sure.
For the PR I needed this change, I included the tagmanager component. The same, what we use on the admin/tracking code page.
It works there, but not working here, because it's not calling that onSiteChange when the page loads. I console.log-d the val and oldVal in the $watch method, and this is how it looks like in the admin page and on the "no data yet page":

// admin page
undefined undefined
8 undefined

// no data yet page
8 8 

I'm not sure where that undefined is coming from but looks like it almost just working accidentally. So I added this "firstTime" check.
Now that I'm thinking through, maybe a better way, like run that when the component loads, but this is working too.

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I was able to reproduce and test. Seems to work as expected now.

@flamisz flamisz merged commit 945face into 4.x-dev Apr 7, 2021
@flamisz flamisz deleted the first-time-sitechange branch April 7, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants