intercom-rails
intercom-rails copied to clipboard
include_for_logged_out_users should still work when user excluded
Hi Intercom devs! Please let me know what you think of this slight change in functionality.
The current behaviour when you have both include_for_logged_out_users
and user.exclude_if
set is a little counter-intuitive. The Intercom dialog appears when you're logged out, and when you're logged in as a valid user, but if you're logged in as an excluded user it disappears.
I'm not sure if there's a use case for this default behaviour, but it seems to make more sense to me to continue showing the include_for_logged_out_users
Intercom dialog for excluded users, if that option is enabled.
This PR changes that - actually by removing a line from IntercomRails::ScriptTag
. Excluded users still get no Intercom dialog at all if include_for_logged_out_users
is false and I've made sure both cases are covered in the tests.
If I've missed your use case, I can make this a separate config option... let me know what works best for you!