Implemented negative filters in back-end, added basic fixed filters settings dialog.

This commit is contained in:
2024-04-02 05:55:53 +02:00
parent 30fdbbd737
commit 98c25cd24e
17 changed files with 260 additions and 43 deletions

View File

@@ -3,6 +3,7 @@ import VueVirtualScroller from 'vue-virtual-scroller';
import FloatingVue from 'floating-vue';
import { setPageContext } from './usePageContext.js';
import initClient from './init-client.js';
import '../assets/css/style.css';
@@ -27,7 +28,6 @@ function createApp(Page, pageProps, pageContext) {
const app = createSSRApp(PageWithLayout);
// We make pageContext available from any Vue component
setPageContext(app, pageContext);
app.provide('pageContext', pageContext);
@@ -38,6 +38,10 @@ function createApp(Page, pageProps, pageContext) {
app.component('Link', Link);
app.component('Icon', Icon);
if (typeof window === 'object') {
initClient(pageContext);
}
return app;
}

14
renderer/init-client.js Normal file
View File

@@ -0,0 +1,14 @@
import Cookies from 'js-cookie';
const cookies = Cookies.withConverter({
write: (value) => value,
});
export default function init(_pageContext) {
// update tag filter to prevent unexpected expiry
const storedTags = cookies.get('tags');
if (storedTags) {
cookies.set('tags', storedTags, { expires: 400 });
}
}