Skip to content

Commit cb1e957

Browse files
committed
fix: improve endpoint loading logic and user feedback in HomePage #deploy
1 parent dca2924 commit cb1e957

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/pages/minisis.jsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const EndpointDropdown = ({
9494
{showLoadButton && (
9595
<button
9696
onClick={onLoadData}
97-
disabled={isLoading || !currentEndpoint}
97+
disabled={isLoading}
9898
className={`
9999
px-4 py-2 text-sm font-medium rounded-md transition-colors
100100
${isLoading
@@ -728,8 +728,19 @@ function HomePage() {
728728

729729
// Handle load data with new endpoint
730730
const handleLoadDataWithEndpoint = () => {
731-
if (usn && dob && selectedEndpoint) {
731+
console.log('Load Data clicked:', { usn, dob, selectedEndpoint, isLoggedIn })
732+
733+
if (!selectedEndpoint) {
734+
toast.error('Please select an endpoint first')
735+
return
736+
}
737+
738+
if (isLoggedIn && usn && dob) {
739+
// User is logged in, just switch endpoint
732740
handleFetchData(usn, dob, selectedEndpoint)
741+
} else {
742+
// User not logged in, show error
743+
toast.error('Please login first before switching endpoints')
733744
}
734745
}
735746

@@ -922,7 +933,7 @@ function HomePage() {
922933
currentEndpoint={selectedEndpoint}
923934
onEndpointChange={handleEndpointChange}
924935
disabled={endpointsLoading || isLoading}
925-
showLoadButton={showLoadButton}
936+
showLoadButton={false}
926937
onLoadData={handleLoadDataWithEndpoint}
927938
isLoading={isLoading}
928939
/>

0 commit comments

Comments
 (0)