perf: No need to fetch boards every middleware call
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -62,9 +62,8 @@ class DefaultBoardService {
|
|||||||
*/
|
*/
|
||||||
public function checkFirstRun($userId): bool {
|
public function checkFirstRun($userId): bool {
|
||||||
$firstRun = $this->config->getUserValue($userId, Application::APP_ID, 'firstRun', 'yes');
|
$firstRun = $this->config->getUserValue($userId, Application::APP_ID, 'firstRun', 'yes');
|
||||||
$userBoards = $this->boardMapper->findAllByUser($userId);
|
|
||||||
|
|
||||||
if ($firstRun === 'yes' && count($userBoards) === 0) {
|
if ($firstRun === 'yes') {
|
||||||
try {
|
try {
|
||||||
$this->config->setUserValue($userId, Application::APP_ID, 'firstRun', 'no');
|
$this->config->setUserValue($userId, Application::APP_ID, 'firstRun', 'no');
|
||||||
} catch (PreConditionNotMetException $e) {
|
} catch (PreConditionNotMetException $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user