mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
fix: theme persistence
save user theme preferences in session instead of localStorage
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { PREFER_DARK_THEME } from '#constants/session';
|
||||
import { defineConfig } from '@adonisjs/inertia';
|
||||
|
||||
export default defineConfig({
|
||||
@@ -11,6 +12,7 @@ export default defineConfig({
|
||||
*/
|
||||
sharedData: {
|
||||
errors: (ctx) => ctx.session?.flashMessages.get('errors'),
|
||||
preferDarkTheme: (ctx) => ctx.session.get(PREFER_DARK_THEME, true),
|
||||
auth: async (ctx) => {
|
||||
await ctx.auth?.check();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user