Skip to content

Commit c81d35c

Browse files
committed
Sync custom list location expanded state with external updates
1 parent bda3910 commit c81d35c

File tree

1 file changed

+5
-0
lines changed
  • desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/components/custom-list-location

1 file changed

+5
-0
lines changed

desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/components/custom-list-location/CustomListLocation.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export function CustomListLocationImpl({
3535
}
3636
}, [customList.locations.length, setExpanded]);
3737

38+
// If custom list state is updated from outside, update state accordingly
39+
useEffect(() => {
40+
setExpanded(customList.expanded);
41+
}, [customList.expanded]);
42+
3843
const handleClick = useCallback(() => {
3944
void handleSelect(customList);
4045
}, [customList, handleSelect]);

0 commit comments

Comments
 (0)