Skip to content

Commit

Permalink
misc: Update pages/Home.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
shuji-koike committed Jan 27, 2024
1 parent 8617fde commit 7d3780e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/app/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AppContext } from "../app"
import { BrowserAlert } from "../components/BrowserAlert"
import { DemoFilePicker } from "../demo/DemoFilePicker"
import { MatchView } from "../demo/MatchView"
import { isValidFile, openDemo, storagePutPublicMatch } from "../demo/io"
import { isValidFile, openDemo } from "../demo/io"
import { useDrragAndDropFile } from "../hooks/useDrragAndDropFile"

export const Home: React.FC = () => {
Expand All @@ -17,9 +17,6 @@ export const Home: React.FC = () => {
if (isValidFile(files[0]))
setMatch(await openDemo(files[0], console.debug, setMatch))
})
React.useEffect(() => {
if (match) logEvent(getAnalytics(), "view_item")
}, [match])
React.useEffect(() => {
if (match) setMatch(undefined)
}, [location.pathname])
Expand All @@ -31,12 +28,9 @@ export const Home: React.FC = () => {
<p>Or click the button below and select a ".dem" file.</p>
<DemoFilePicker
setMatch={setMatch}
onLoad={async (match, name) => {
const path = /\.dem$/i.test(name)
? await storagePutPublicMatch(match, name)
: name
console.info(path)
// navigate(`/dem/${path}/`, { state: { match } })
onLoad={() => {
console.log("DemoFilePicker:onLoad")

Check warning on line 32 in packages/app/pages/Home.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
logEvent(getAnalytics(), "DemoFilePicker:onLoad")
}}
/>
<BrowserAlert />
Expand Down

0 comments on commit 7d3780e

Please sign in to comment.