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
backgroundColor='red'
onClick={() => {
RestClient.DELETE(`/todo/${todo.id}`).then(
() => (window.location.href = '/')
);
RestClient.DELETE(`/todo/${todo.id}`).then(() => fetchTodos());
}}
>
🗑

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

Loading…
Cancel
Save