fix: Removed last couple instances of window.location

main
phga 2 years ago
parent 5c71cc6b17
commit b0e46a5ed6
Signed by: phga
GPG Key ID: 5249548AA705F019

@ -191,9 +191,7 @@ const Home: Component = () => {
<Button <Button
backgroundColor='red' backgroundColor='red'
onClick={() => { onClick={() => {
RestClient.DELETE(`/todo/${todo.id}`).then( RestClient.DELETE(`/todo/${todo.id}`).then(() => fetchTodos());
() => (window.location.href = '/')
);
}} }}
> >
🗑 🗑

@ -1,4 +1,4 @@
import { useNavigate } from '@solidjs/router'; import { A, useNavigate } from '@solidjs/router';
import { Component, Show } from 'solid-js'; import { Component, Show } from 'solid-js';
import RestClient from '../api/RestClient'; import RestClient from '../api/RestClient';
import { user, setUser } from '../App'; import { user, setUser } from '../App';
@ -9,12 +9,12 @@ const Navbar: Component = () => {
return ( return (
<div class='flex justify-between items-center bg-sh-bg p-3'> <div class='flex justify-between items-center bg-sh-bg p-3'>
<div class='flex items-center'> <div class='flex items-center'>
<a <A
href='/' href='/'
class='pl-2 text-xl font-bold no-underline text-sh-yellow hover:text-sh-yellowM1' class='pl-2 text-xl font-bold no-underline text-sh-yellow hover:text-sh-yellowM1'
> >
Just todo it! Just todo it!
</a> </A>
</div> </div>
<h1 class='flex -ml-20 text-xl font-bold no-underline text-sh-yellow'> <h1 class='flex -ml-20 text-xl font-bold no-underline text-sh-yellow'>
Hey {user().login}! Hey {user().login}!
@ -33,7 +33,7 @@ const Navbar: Component = () => {
onClick={() => { onClick={() => {
RestClient.DELETE('/logout'); RestClient.DELETE('/logout');
setUser({ id: '', login: '' }); setUser({ id: '', login: '' });
('/login'); nav('/login');
}} }}
backgroundColor='magenta' backgroundColor='magenta'
color='black' color='black'

Loading…
Cancel
Save