Compare commits

..

2 Commits

Author SHA1 Message Date
Li1304553726 9f4019cb94 Merge branch 'main' of http://113.45.67.59:3003/lzq/test 2025-11-17 19:50:14 +08:00
Li1304553726 5bf049c66f 1 2025-11-17 19:50:12 +08:00
2 changed files with 1 additions and 5 deletions

View File

@ -74,9 +74,6 @@ export function WeatherSearchForm() {
<div className='flex gap-2'>
<Button type="submit" disabled={isLoading || !city.trim()} className="mt-4 w-full">
{isLoading ? <>
<Loader2 className="animate-spin w-5 h-5 text-white" />
<span>...</span>
@ -85,7 +82,6 @@ export function WeatherSearchForm() {
<span></span>
</>)}
</Button>
{currentWeather && (
<Button type="button" variant="outline" onClick={refreshWeather} disabled={isLoading} className="mt-4 w-full" title='刷新数据'>
<RefreshCw className={cn("w-5 h-5", isLoading && "animate-spin")} />

View File

@ -89,7 +89,7 @@ export const useWeatherStore = create<WeatherStore>()(
return{weatherCache:newCache}
}),
setLoading:(loading)=>set({isLoading:loading}),
setError:(error)=>set({error}),
setError:(error)=>set({error,isLoading:false}),
reset:()=>set({currentWeather:null,weatherCache:new Map(),isLoading:false,error:null}),
searchWeather:async(city:string)=>{
try{