mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
Update ItemList API
This commit is contained in:
@@ -6,13 +6,11 @@ import CommentPost from 'flarum/components/CommentPost';
|
||||
|
||||
app.initializers.add('flarum-akismet', () => {
|
||||
extend(PostControls, 'destructiveControls', function(items, post) {
|
||||
if (items.approve) {
|
||||
if (items.has('approve')) {
|
||||
const flags = post.flags();
|
||||
|
||||
if (flags && flags.some(flag => flag.type() === 'akismet')) {
|
||||
Object.assign(items.approve.content.props, {
|
||||
children: 'Not Spam'
|
||||
});
|
||||
items.get('approve').props.children = 'Not Spam';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user