DEV: Make DTooltipInstance destroy synchronous (#24439)
Having async cleanup on a modifier is problematic because it means it might persist beyond the end of a test, leading to flaky 'Test is not isolated' errors.
This commit is contained in:
parent
9d8abcbdfe
commit
0a58564ddd
|
@ -56,8 +56,8 @@ export default class DTooltipInstance extends FloatKitInstance {
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async destroy() {
|
destroy() {
|
||||||
await this.close();
|
this.close();
|
||||||
this.tearDownListeners();
|
this.tearDownListeners();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { tracked } from "@glimmer/tracking";
|
import { tracked } from "@glimmer/tracking";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { cancel, next } from "@ember/runloop";
|
import { cancel } from "@ember/runloop";
|
||||||
import { makeArray } from "discourse-common/lib/helpers";
|
import { makeArray } from "discourse-common/lib/helpers";
|
||||||
import discourseLater from "discourse-common/lib/later";
|
import discourseLater from "discourse-common/lib/later";
|
||||||
import { bind } from "discourse-common/utils/decorators";
|
import { bind } from "discourse-common/utils/decorators";
|
||||||
|
@ -20,17 +20,13 @@ export default class FloatKitInstance {
|
||||||
content = null;
|
content = null;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async show() {
|
show() {
|
||||||
this.expanded = true;
|
this.expanded = true;
|
||||||
|
|
||||||
await new Promise((resolve) => next(resolve));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async close() {
|
close() {
|
||||||
this.expanded = false;
|
this.expanded = false;
|
||||||
|
|
||||||
await new Promise((resolve) => next(resolve));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Reference in New Issue