[NoteActions] Refactor note actions and fix bug in favourite

This commit is contained in:
Hugo Sales
2020-09-10 20:29:57 +00:00
committed by Hugo Sales
parent 4c15271d36
commit 72208b066c
3 changed files with 30 additions and 29 deletions

View File

@@ -60,6 +60,11 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
public function getNoteActions(Note $note)
{
// Only show buttons if a user is logged in
if (Common::user() == null) {
return [];
}
$actions = [];
Event::handle('add_note_actions', [$this->request, $note, &$actions]);
return $actions;