Fixed pages breaking when logged out.
This commit is contained in:
@@ -6,11 +6,11 @@ import { fetchUserTemplates } from '../users.js';
|
||||
import { fetchUnseenNotificationsCount } from '../alerts.js';
|
||||
|
||||
export default async function mainHandler(req, res, next) {
|
||||
const [stashes, templates, unseenNotifications] = req.user && await Promise.all([
|
||||
const [stashes, templates, unseenNotifications] = req.user ? await Promise.all([
|
||||
fetchUserStashes(req.user.id, req.user),
|
||||
fetchUserTemplates(req.user),
|
||||
fetchUnseenNotificationsCount(req.user),
|
||||
]);
|
||||
]) : [];
|
||||
|
||||
const pageContextInit = {
|
||||
urlOriginal: req.originalUrl,
|
||||
|
||||
Reference in New Issue
Block a user