mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 01:24:03 +08:00
a433b30650
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
25 lines
641 B
JavaScript
25 lines
641 B
JavaScript
import { tagName } from "@ember-decorators/component";
|
|
import { action } from "@ember/object";
|
|
import Component from "@ember/component";
|
|
import DiscourseURL from "discourse/lib/url";
|
|
|
|
@tagName("")
|
|
export default class StaffActions extends Component {
|
|
@action
|
|
openLinks(event) {
|
|
const dataset = event.target.dataset;
|
|
|
|
if (dataset.linkPostId) {
|
|
event.preventDefault();
|
|
|
|
this.store.find("post", dataset.linkPostId).then((post) => {
|
|
DiscourseURL.routeTo(post.url);
|
|
});
|
|
} else if (dataset.linkTopicId) {
|
|
event.preventDefault();
|
|
|
|
DiscourseURL.routeTo(`/t/${dataset.linkTopicId}`);
|
|
}
|
|
}
|
|
}
|