mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 13:34:08 +08:00
23 lines
506 B
JavaScript
23 lines
506 B
JavaScript
import { setOwner } from "@ember/application";
|
|
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import uniqueId from "discourse/helpers/unique-id";
|
|
import { TOAST } from "float-kit/lib/constants";
|
|
|
|
export default class DToastInstance {
|
|
@service toasts;
|
|
|
|
options = null;
|
|
id = uniqueId();
|
|
|
|
constructor(owner, options = {}) {
|
|
setOwner(this, owner);
|
|
this.options = { ...TOAST.options, ...options };
|
|
}
|
|
|
|
@action
|
|
close() {
|
|
this.toasts.close(this);
|
|
}
|
|
}
|