How can I set a condition to run only on certain pages?

I have a notification bubble that is visible when a user has unread chat messages. It performs a search on the user to see if they have unread messages. It is on the header so this action runs on every page. Is there a way to not let it run on certain pages? For instance I don’t want it to run on the index/landing page because it slows the loading of those pages.

image

I was thinking about adding to the end of that expression something like AND current page is not index. But would it still perform the first part of the expression, the search for messages?

Hi there, @ramzizi… if you do the page check as the first part of the expression, the second part of the expression (the search) won’t run if the page check doesn’t pass.

Hope this helps.

Best…
Mike

1 Like

thanks, that did it

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.