fix: Removed last couple instances of window.location
This commit is contained in:
parent
5c71cc6b17
commit
b0e46a5ed6
@ -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…
x
Reference in New Issue
Block a user