[UI][CACHE][DB] Add follow counts to left panel, caching the results; change follow table

This commit is contained in:
Hugo Sales
2020-08-15 07:03:58 +00:00
committed by Hugo Sales
parent 3c67773e59
commit 65a129aac6
4 changed files with 36 additions and 16 deletions

View File

@@ -20,6 +20,7 @@
namespace Component\Left;
use App\Core\Event;
use App\Core\Log;
use App\Core\Module;
use App\Util\Common;
use Exception;
@@ -31,10 +32,14 @@ class Left extends Module
try {
$user = Common::user();
if ($user != null) {
$vars['user_nickname'] = $user->getNickname();
$vars['user_tags'] = $user->getActor()->getSelfTags();
$actor = $user->getActor();
$vars['user_nickname'] = $user->getNickname();
$vars['user_tags'] = $actor->getSelfTags();
$vars['user_followers'] = $actor->getFollowersCount();
$vars['user_followed'] = $actor->getFollowedCount();
}
} catch (Exception $e) {
Log::error('Got an exception while populating variables for the left panel: ' . $e);
}
return Event::next;
}