Skip to content

Commit

Permalink
fix: set obj type before search enter (close AlistGo/alist#3723)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Mar 6, 2023
1 parent e2043e3 commit dfafe1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/home/folder/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { BsSearch } from "solid-icons/bs"
import { createSignal, For, Match, onCleanup, Show, Switch } from "solid-js"
import { FullLoading, LinkWithBase } from "~/components"
import { useFetch, useRouter, useT } from "~/hooks"
import { useFetch, usePath, useRouter, useT } from "~/hooks"
import { getMainColor, me, password } from "~/store"
import { SearchNode } from "~/types"
import {
Expand All @@ -32,6 +32,7 @@ import { isMac } from "~/utils/compatibility"
import { getIconByObj } from "~/utils/icon"

const SearchResult = (props: SearchNode) => {
const { setPathAs } = usePath()
return (
<HStack
w="$full"
Expand All @@ -45,6 +46,9 @@ const SearchResult = (props: SearchNode) => {
as={LinkWithBase}
href={props.path}
encode
onMouseEnter={() => {
setPathAs(props.path, props.is_dir)
}}
>
<Icon
class="icon"
Expand Down

0 comments on commit dfafe1e

Please sign in to comment.