DEV: Resolve registerUnbound deprecation (#188)
This commit is contained in:
parent
331c8630c3
commit
a3883d2a9a
|
@ -1,8 +1,7 @@
|
||||||
import { registerUnbound } from "discourse-common/lib/helpers";
|
|
||||||
import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
|
import { autoUpdatingRelativeAge } from "discourse/lib/formatter";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
registerUnbound("format-unix-date", function (timestamp) {
|
export default function formatUnixDate(timestamp) {
|
||||||
if (timestamp) {
|
if (timestamp) {
|
||||||
const date = new Date(moment.unix(timestamp).format());
|
const date = new Date(moment.unix(timestamp).format());
|
||||||
|
|
||||||
|
@ -14,4 +13,4 @@ registerUnbound("format-unix-date", function (timestamp) {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { registerUnbound } from "discourse-common/lib/helpers";
|
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
|
||||||
export default registerUnbound("user-viewing-self", function (model) {
|
export default function userViewingSelf(model) {
|
||||||
if (User.current()) {
|
if (User.current()) {
|
||||||
return (
|
return (
|
||||||
User.current().username.toLowerCase() === model.username.toLowerCase()
|
User.current().username.toLowerCase() === model.username.toLowerCase()
|
||||||
|
@ -9,4 +8,4 @@ export default registerUnbound("user-viewing-self", function (model) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
}
|
||||||
|
|
Loading…
Reference in New Issue