Update dependencies and add new features
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
import { page } from "$app/stores";
|
||||
import { inject } from "@vercel/analytics";
|
||||
import { injectSpeedInsights } from "@vercel/speed-insights/sveltekit";
|
||||
import "iconify-icon";
|
||||
|
||||
if (data.usingVercel === "true") {
|
||||
inject();
|
||||
|
||||
@@ -3,7 +3,9 @@ import { fail, redirect } from "@sveltejs/kit";
|
||||
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async (event: { locals: { user: any; }; }) => {
|
||||
export const load: PageServerLoad = async (event: {
|
||||
locals: { user: any };
|
||||
}) => {
|
||||
if (event.locals.user)
|
||||
return {
|
||||
user: event.locals.user,
|
||||
@@ -28,10 +30,15 @@ export const actions: Actions = {
|
||||
});
|
||||
return redirect(302, "/login");
|
||||
},
|
||||
setTheme: async ( { url, cookies }) => {
|
||||
setTheme: async ({ url, cookies }) => {
|
||||
const theme = url.searchParams.get("theme");
|
||||
// change the theme only if it is one of the allowed themes
|
||||
if (theme && ["light", "dark", "night", "retro", "forest", "nord"].includes(theme)) {
|
||||
if (
|
||||
theme &&
|
||||
["light", "dark", "night", "retro", "forest", "aqua", "forest"].includes(
|
||||
theme
|
||||
)
|
||||
) {
|
||||
cookies.set("colortheme", theme, {
|
||||
path: "/",
|
||||
maxAge: 60 * 60 * 24 * 365,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{/if}
|
||||
|
||||
<img src={campingDrawing} class="w-1/4 mb-4" alt="Logo" />
|
||||
<button on:click={navToLog} class="btn btn-primary">Open Log</button>
|
||||
<button on:click={navToLog} class="btn btn-primary mb-4">Open Log</button>
|
||||
|
||||
<div class="stats shadow">
|
||||
<div class="stat">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let data;
|
||||
console.log(data.result);
|
||||
import { goto } from "$app/navigation";
|
||||
import AdventureCard from "$lib/components/AdventureCard.svelte";
|
||||
import { visitCount } from "$lib/utils/stores/visitCountStore.js";
|
||||
|
||||
Reference in New Issue
Block a user