mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 09:54:56 +08:00
`registerUnbound` was present for legacy reasons when using helpers in raw-hbs and has been replaced by `registerRawHelper`. For new helpers used only in classic ember template, exporting a default function from `helpers/*.js` is recommended. This change also means that all existing helpers will be available to import in `gjs` files. Co-authored-by: David Taylor <david@taylorhq.com>
10 lines
352 B
JavaScript
Vendored
10 lines
352 B
JavaScript
Vendored
import { htmlSafe } from "@ember/template";
|
|
import { registerRawHelper } from "discourse-common/lib/helpers";
|
|
import { renderIcon } from "discourse-common/lib/icon-library";
|
|
|
|
registerRawHelper("check-icon", checkIcon);
|
|
|
|
export default function checkIcon(value) {
|
|
let icon = value ? "check" : "times";
|
|
return htmlSafe(renderIcon("string", icon));
|
|
}
|