FIX: at this point in time component can be destroyed (#19677)
Especially possible in tests
This commit is contained in:
parent
cb2f684a43
commit
96e2d92129
|
@ -131,6 +131,10 @@ export default Component.extend({
|
|||
|
||||
@action
|
||||
fetchChannelsFromServer(filter) {
|
||||
if (this.isDestroyed || this.isDestroying) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setProperties({
|
||||
loading: true,
|
||||
searchIndex: this.searchIndex + 1,
|
||||
|
@ -165,6 +169,10 @@ export default Component.extend({
|
|||
|
||||
@action
|
||||
getInitialChannels() {
|
||||
if (this.isDestroyed || this.isDestroying) {
|
||||
return;
|
||||
}
|
||||
|
||||
const channels = this.getChannelsWithFilter(this.filter);
|
||||
this.set("channels", channels);
|
||||
this.focusFirstChannel(channels);
|
||||
|
|
Loading…
Reference in New Issue