Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
swap window.onload for createEffect in RangeInput component
Browse files Browse the repository at this point in the history
  • Loading branch information
ewof committed Feb 9, 2023
1 parent 2a2fbc0 commit 8c4b29e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import NavBar from "./shared/NavBar";

const ChatPage = lazy(() => import("./pages/Chat"));
const CharacterSettings = lazy(() => import("./pages/CharacterSettings"));
const GenerationSettings = lazy(() => import("./pages/GenerationSettings"));
const Home = lazy(() => import("./pages/Home"));
const Login = lazy(() => import("./pages/Login"));

Expand All @@ -17,6 +18,7 @@ const App: Component = () => (
<Routes>
<Route path="/chat" component={ChatPage} />
<Route path="/character" component={CharacterSettings} />
<Route path="/generation-settings" component={GenerationSettings} />
<Route path="/" component={Home} />
<Route path="/account/login" component={Login} />
</Routes>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/RangeInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Show, createSignal } from "solid-js";
import { Component, Show, createSignal, createEffect } from "solid-js";
import type { JSX } from "solid-js";

const RangeInput: Component<{
Expand All @@ -23,7 +23,7 @@ const RangeInput: Component<{
updateRangeSliders();
};

window.onload = updateRangeSliders;
createEffect(updateRangeSliders);

return (
<div class="relative pt-1">
Expand Down

0 comments on commit 8c4b29e

Please sign in to comment.