DEV: Fix set-after-destroy issues (#15078)
Fixes broken tests on the legacy ember env.
This commit is contained in:
parent
9380c1273e
commit
e41f98bf96
|
@ -12,6 +12,10 @@ export default Component.extend({
|
|||
this._super(...arguments);
|
||||
|
||||
ajax("/admin/dashboard/new-features.json").then((json) => {
|
||||
if (!this.element || this.isDestroying || this.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setProperties({
|
||||
newFeatures: json.new_features,
|
||||
hasUnseenFeatures: json.has_unseen_features,
|
||||
|
|
|
@ -211,6 +211,10 @@ export default Controller.extend(
|
|||
|
||||
return User.checkEmail(this.accountEmail)
|
||||
.then((result) => {
|
||||
if (this.isDestroying || this.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.failed) {
|
||||
this.setProperties({
|
||||
serverAccountEmail: this.accountEmail,
|
||||
|
@ -356,6 +360,10 @@ export default Controller.extend(
|
|||
this.set("formSubmitted", true);
|
||||
return User.createAccount(attrs).then(
|
||||
(result) => {
|
||||
if (this.isDestroying || this.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set("isDeveloper", false);
|
||||
if (result.success) {
|
||||
// invalidate honeypot
|
||||
|
|
|
@ -86,6 +86,10 @@ export default Mixin.create({
|
|||
checkUsernameAvailability() {
|
||||
return User.checkUsername(this.accountUsername, this.accountEmail).then(
|
||||
(result) => {
|
||||
if (this.isDestroying || this.isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set("isDeveloper", false);
|
||||
if (result.available) {
|
||||
if (result.is_developer) {
|
||||
|
|
Loading…
Reference in New Issue