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>
|
<BasicPageWrapper>
|
||||||
<BasicPageContainer>
|
<BasicPageContainer>
|
||||||
<div class="space-y-5 md:space-y-4">
|
<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 class="space-y-5 md:space-y-4 mx-auto max-w-3xl w-full">
|
||||||
<div>
|
<div>
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default {
|
|||||||
name: "Index",
|
name: "Index",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
favoriteGroups: JSON.parse(localStorage.getItem('favoriteGroups')),
|
favoriteGroups: typeof window !== 'undefined' ? JSON.parse(localStorage.getItem('favoriteGroups') || '[]') : [],
|
||||||
showFavorites: false,
|
showFavorites: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
currentPageLoaded: this.schedules_paginator.current_page,
|
currentPageLoaded: this.schedules_paginator.current_page,
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
filters: {
|
filters: {
|
||||||
type: Object,
|
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 '../css/app.css';
|
||||||
import { createInertiaApp } from '@inertiajs/vue3'
|
import { createInertiaApp } from '@inertiajs/vue3'
|
||||||
import createServer from '@inertiajs/vue3/server'
|
import createServer from '@inertiajs/vue3/server'
|
||||||
|
|||||||
Reference in New Issue
Block a user