Skip to content

Commit

Permalink
Merge pull request #111 from nini22P/dev
Browse files Browse the repository at this point in the history
fix: add account check on search
  • Loading branch information
nini22P authored Jun 26, 2024
2 parents 2f8b84c + f8b4b6b commit 00616ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "omp",
"description": "OneDrive Media Player",
"private": true,
"version": "1.8.0",
"version": "1.8.1",
"scripts": {
"dev": "webpack serve",
"build": "webpack --mode=production --node-env=production",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Search = ({ type = 'icon' }: { type?: 'icon' | 'bar' }) => {
}

const { data: filesData } = useSWR(
`${account.username}/${path}`,
account ? `${account.username}/${path}` : null,
() => fileListFetcher(path),
)

Expand All @@ -60,7 +60,7 @@ const Search = ({ type = 'icon' }: { type?: 'icon' | 'bar' }) => {
}

const { data: searchData, isLoading: searchIsLoading } = useSWR(
(debouncedSearchQuery.length > 0) ? `${account.username}/${path}/${debouncedSearchQuery}` : null,
(debouncedSearchQuery.length > 0) && account ? `${account.username}/${path}/${debouncedSearchQuery}` : null,
() => searchFetcher(path, debouncedSearchQuery),
)

Expand Down

0 comments on commit 00616ef

Please sign in to comment.