Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

How to stop the pollFriendsList directive? #120

Closed
Nesbox314 opened this issue Apr 22, 2019 · 6 comments
Closed

How to stop the pollFriendsList directive? #120

Nesbox314 opened this issue Apr 22, 2019 · 6 comments

Comments

@Nesbox314
Copy link

In my API, I can only make requests while logged in, and my question is that the chat continues to try to polling even when logged off, on the login screen, by playing continuous errors. Please HELP!

@rpaschoal
Copy link
Owner

Hi @Nesbox314 ,

Just add a *ngIf and don't render your chat component if you are not logged in. This should do the trick! 😺

@Nesbox314
Copy link
Author

I gonna try, thanks!

@paulStr
Copy link

paulStr commented Aug 8, 2019

Hi @Nesbox314 ,

I'm doing just that, not rendering the component using an *ngIf but the polling still happens. I wasn't able to find a way to stop the polling once you start it.

@rpaschoal
Copy link
Owner

Might be worth while some investigation then. I'm gonna chunk a bug label on this so it can be worked on for a next release @paulStr

@rpaschoal
Copy link
Owner

Some interesting read on this: angular/angular#23756

I'm going to add an @Input (eg: isDisabled) prop so it can disable the behavior of ng-chat internally nonetheless.

@rpaschoal
Copy link
Owner

This should now be fixed with version 2.0.5: https://github.com/rpaschoal/ng-chat/releases/tag/2.0.5 👍

You will have to use the isDisabled property to hide ng-chat and that will remove the interval of the friend list poll mechanism.

@paulStr and @Nesbox314 ^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants