fix(ssr): polyfill localStorage/sessionStorage, guard BasicListBadge filters prop, remove this. from template
This commit is contained in:
@@ -103,7 +103,7 @@ export default {
|
||||
<BasicPageWrapper>
|
||||
<BasicPageContainer>
|
||||
<div class="space-y-5 md:space-y-4">
|
||||
<ProgramTitle class="text-center" :header="this.campaignName" />
|
||||
<ProgramTitle class="text-center" :header="campaignName" />
|
||||
<div class="space-y-5 md:space-y-4 mx-auto max-w-3xl w-full">
|
||||
<div>
|
||||
<div class="">
|
||||
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
name: "Index",
|
||||
data() {
|
||||
return {
|
||||
favoriteGroups: JSON.parse(localStorage.getItem('favoriteGroups')),
|
||||
favoriteGroups: typeof window !== 'undefined' ? JSON.parse(localStorage.getItem('favoriteGroups') || '[]') : [],
|
||||
showFavorites: false,
|
||||
loading: false,
|
||||
currentPageLoaded: this.schedules_paginator.current_page,
|
||||
|
||||
@@ -48,6 +48,7 @@ export default {
|
||||
props: {
|
||||
filters: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -7,6 +7,24 @@ if (typeof globalThis.IntersectionObserver === 'undefined') {
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof globalThis.localStorage === 'undefined') {
|
||||
const noop = () => '';
|
||||
globalThis.localStorage = { getItem: noop, setItem: noop, removeItem: noop, clear: noop, get length() { return 0; }, key: noop };
|
||||
}
|
||||
|
||||
if (typeof globalThis.sessionStorage === 'undefined') {
|
||||
const noop = () => '';
|
||||
globalThis.sessionStorage = { getItem: noop, setItem: noop, removeItem: noop, clear: noop, get length() { return 0; }, key: noop };
|
||||
}
|
||||
|
||||
if (typeof globalThis.window === 'undefined') {
|
||||
globalThis.window = globalThis;
|
||||
}
|
||||
|
||||
if (typeof globalThis.document === 'undefined') {
|
||||
globalThis.document = { createElement: () => ({ style: {} }), querySelector: () => null, head: { appendChild: () => {} }, body: { appendChild: () => {} } };
|
||||
}
|
||||
|
||||
import '../css/app.css';
|
||||
import { createInertiaApp } from '@inertiajs/vue3'
|
||||
import createServer from '@inertiajs/vue3/server'
|
||||
|
||||
Reference in New Issue
Block a user