mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:42:53 +08:00
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
|
@action
|
||||||
fetchChannelsFromServer(filter) {
|
fetchChannelsFromServer(filter) {
|
||||||
|
if (this.isDestroyed || this.isDestroying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
loading: true,
|
loading: true,
|
||||||
searchIndex: this.searchIndex + 1,
|
searchIndex: this.searchIndex + 1,
|
||||||
|
@ -165,6 +169,10 @@ export default Component.extend({
|
||||||
|
|
||||||
@action
|
@action
|
||||||
getInitialChannels() {
|
getInitialChannels() {
|
||||||
|
if (this.isDestroyed || this.isDestroying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const channels = this.getChannelsWithFilter(this.filter);
|
const channels = this.getChannelsWithFilter(this.filter);
|
||||||
this.set("channels", channels);
|
this.set("channels", channels);
|
||||||
this.focusFirstChannel(channels);
|
this.focusFirstChannel(channels);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user