File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ export default function SessionContextProvider({ children }: Props) {
20
20
method : "POST" ,
21
21
credentials : "include" ,
22
22
} ) ;
23
- // Refresh the page to start fresh
24
- window . location . reload ( ) ;
25
23
} catch ( error ) {
26
24
console . error ( "Failed to clear session:" , error ) ;
27
25
// Fallback: just refresh the page
Original file line number Diff line number Diff line change @@ -30,16 +30,13 @@ interface Props {
30
30
31
31
export default function CitySelectField ( { setMessages } : Props ) {
32
32
const [ city , setCity ] = useState < string | null > ( null ) ;
33
- const [ invalidCity , setInvalidCity ] = useState < boolean > ( false ) ;
34
33
const { initChat } = useMessages ( ) ;
35
34
36
35
const handleCityChange = async ( key : string | null ) => {
37
36
setCity ( key ) ;
38
37
const selectedCity =
39
38
CitySelectOptions [ key as keyof typeof CitySelectOptions ] ;
40
39
if ( selectedCity && selectedCity . state ) {
41
- setInvalidCity ( false ) ;
42
-
43
40
try {
44
41
await initChat ( { city : selectedCity . city , state : selectedCity . state } ) ;
45
42
@@ -56,17 +53,14 @@ export default function CitySelectField({ setMessages }: Props) {
56
53
] ) ;
57
54
} catch ( error ) {
58
55
console . error ( "Error initializing session:" , error ) ;
59
- setInvalidCity ( true ) ;
60
56
}
61
- } else {
62
- setInvalidCity ( true ) ;
63
57
}
64
58
} ;
65
59
66
60
return (
67
61
< div className = "flex flex-col gap-2" >
68
62
< p className = "text-center text-[#888] mb-10" >
69
- { invalidCity
63
+ { city
70
64
? "Unfortunately we can only answer questions about tenant rights in Oregon right now."
71
65
: "Welcome to Tenant First Aid! I can answer your questions about tenant rights in Oregon. To get started, what city are you located in?" }
72
66
</ p >
You can’t perform that action at this time.
0 commit comments