Fixed pages breaking when logged out.
This commit is contained in:
parent
3bf9a6f09f
commit
b2ea29d72c
|
@ -141,7 +141,7 @@ const props = defineProps({
|
||||||
const pageContext = inject('pageContext');
|
const pageContext = inject('pageContext');
|
||||||
const user = pageContext.user;
|
const user = pageContext.user;
|
||||||
const pageStash = pageContext.pageProps.stash;
|
const pageStash = pageContext.pageProps.stash;
|
||||||
const currentStash = pageStash || pageContext.assets.primaryStash;
|
const currentStash = pageStash || pageContext.assets?.primaryStash;
|
||||||
|
|
||||||
const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === currentStash?.id));
|
const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === currentStash?.id));
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,11 +6,11 @@ import { fetchUserTemplates } from '../users.js';
|
||||||
import { fetchUnseenNotificationsCount } from '../alerts.js';
|
import { fetchUnseenNotificationsCount } from '../alerts.js';
|
||||||
|
|
||||||
export default async function mainHandler(req, res, next) {
|
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),
|
fetchUserStashes(req.user.id, req.user),
|
||||||
fetchUserTemplates(req.user),
|
fetchUserTemplates(req.user),
|
||||||
fetchUnseenNotificationsCount(req.user),
|
fetchUnseenNotificationsCount(req.user),
|
||||||
]);
|
]) : [];
|
||||||
|
|
||||||
const pageContextInit = {
|
const pageContextInit = {
|
||||||
urlOriginal: req.originalUrl,
|
urlOriginal: req.originalUrl,
|
||||||
|
|
Loading…
Reference in New Issue