[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

@@ -35,12 +35,7 @@ class Favourite extends Module
{
public function onAddNoteActions(Request $request, Note $note, array &$actions)
{
$user = Common::user();
// Only show buttons if a user is logged in
if ($user == null) {
return Event::next;
}
$user = Common::user();
$opts = ['note_id' => $note->getId(), 'gsactor_id' => $user->getId()];
$is_set = DB::find('favourite', $opts) != null;
$form = Form::create([