File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { resolve } from "$app/paths" ;
12import type { LayoutLoad } from "./$types"
23import { redirect } from "@sveltejs/kit" ;
34
45export const load : LayoutLoad = async ( { parent } ) => {
56 const { spotify } = await parent ( )
6- if ( ! spotify . user ) redirect ( 303 , "/" ) ;
7+ if ( ! spotify . user ) redirect ( 303 , resolve ( "/" ) ) ;
78}
Original file line number Diff line number Diff line change 3232 </div >
3333 {/each }
3434
35- <!-- <a class="playlist wireframe" href="/create-playlist">+</a> -->
35+ <!-- <a class="playlist wireframe" href={resolve( "/create-playlist")} >+</a> -->
3636</main >
Original file line number Diff line number Diff line change 22 import type { Snippet } from ' svelte' ;
33 import GithubLogo from ' virtual:icons/logos/github-icon' ;
44 import ' ./styles.css' ;
5+ import { resolve } from ' $app/paths' ;
56
67 let { data, children } = $props ();
78 </script >
1819 <header
1920 class =" relative grid grid-cols-[repeat(2,max-content)_1fr] justify-items-end items-center gap-8 overflow-scroll pb-8 px-8"
2021 >
21- <a href =" / "
22- > <img src =" favicon.png" alt =" autofy icon" class =" h-8 aspect-square rounded-full" /></ a
23- >
24- <a class =" autofy font-black text-[2rem]" href =" / " >autofy</a >
22+ <a href ={ resolve ( ' / ' )}>
23+ <img src =" favicon.png" alt =" autofy icon" class =" h-8 aspect-square rounded-full" />
24+ </ a >
25+ <a class ="autofy font-black text-[2rem]" href ={ resolve ( ' / ' )} >autofy</a >
2526
2627 {#if data .spotify .user }
2728 {#if data .spotify .user .image }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { LayoutLoad } from "./$types";
22import { SignIn as SpotifySignIn , SignOut as SpotifySignOut } from "$lib/spotify" ;
33import { spotify } from "$lib/state.svelte" ;
44import { goto } from "$app/navigation" ;
5+ import { resolve } from "$app/paths" ;
56
67export const ssr = false ;
78export const prerender = true ;
@@ -13,11 +14,11 @@ export const load: LayoutLoad = async ({ url }) => {
1314
1415async function SignIn ( ) {
1516 spotify . user = await SpotifySignIn ( )
16- goto ( "/playlists" )
17+ goto ( resolve ( "/playlists" ) )
1718}
1819
1920async function SignOut ( ) {
2021 await SpotifySignOut ( )
2122 spotify . user = null
22- goto ( "/" )
23+ goto ( resolve ( "/" ) )
2324}
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { resolve } from ' $app/paths' ;
3+
24 let { data } = $props ();
35
46 const BUTTON_CLASS =
2325 </p >
2426
2527 {#if data .spotify .user }
26- <a href =" /playlists" class ={BUTTON_CLASS }> my playlists </a >
28+ <a href ={ resolve ( ' /playlists' )} class ={BUTTON_CLASS }> my playlists </a >
2729 {:else }
2830 <button onclick ={data .SignIn } class ={BUTTON_CLASS }>
2931 connect your Spotify account to get started!
You can’t perform that action at this time.
0 commit comments