Skip to content

Commit

Permalink
Fix list of last dirs not updating when switching servers
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1ck committed Apr 14, 2024
1 parent d23bf04 commit f19c65b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/modals/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ export interface LocationData {
export function useTorrentLocation(): LocationData {
const config = useContext(ConfigContext);
const serverConfig = useContext(ServerConfigContext);
const [lastPaths, setLastPaths] = useState(serverConfig.lastSaveDirs);
const [lastPaths, setLastPaths] = useState([] as string[]);

useEffect(() => {
setLastPaths(serverConfig.lastSaveDirs);
}, [serverConfig]);

const [path, setPath] = useState<string>("");

Expand Down

0 comments on commit f19c65b

Please sign in to comment.