aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/note_fragment.php
diff options
context:
space:
mode:
Diffstat (limited to 'routes/note_fragment.php')
-rw-r--r--routes/note_fragment.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/routes/note_fragment.php b/routes/note_fragment.php
index 53fd7af..a992a61 100644
--- a/routes/note_fragment.php
+++ b/routes/note_fragment.php
@@ -20,8 +20,8 @@ Router::getInstance()->mount('/fragment/note/:id/:action', function (array $args
if ($interaction == null) {
// we are adding a new interaction
- $newint = Interaction::create($user->actor, InteractionKind::from($action), $note);
- $newint->publish();
+ $interaction = Interaction::create($user->actor, InteractionKind::from($action), $note);
+ $interaction->publish();
$active = true;
} else {
// we are removing the existing one
@@ -29,7 +29,12 @@ Router::getInstance()->mount('/fragment/note/:id/:action', function (array $args
$active = false;
}
- render_template('interaction_button', ['action' => $args['action'], 'active' => $active, 'note' => $note]);
+ render_template('interaction_button', [
+ 'action' => $args['action'],
+ 'active' => $active,
+ 'note' => $note,
+ 'count' => $note->countInteractionsOfKind($interaction->kind)
+ ]);
});
Router::getInstance()->mount('/fragment/note/:id/reply', function (array $args) {