mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-04 10:30:00 -06:00
add loading spinner to logout process
This commit is contained in:
@@ -55,6 +55,7 @@ interface EnvironmentsNavbarProps {
|
||||
|
||||
export default function EnvironmentsNavbar({ environmentId, session }: EnvironmentsNavbarProps) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { environment, isErrorEnvironment, isLoadingEnvironment } = useEnvironment(environmentId);
|
||||
const pathname = usePathname();
|
||||
|
||||
@@ -180,7 +181,7 @@ export default function EnvironmentsNavbar({ environmentId, session }: Environme
|
||||
router.push(`/environments/${newEnvironmentId}/`);
|
||||
};
|
||||
|
||||
if (isLoadingEnvironment) {
|
||||
if (isLoadingEnvironment || loading) {
|
||||
return <LoadingSpinner />;
|
||||
}
|
||||
|
||||
@@ -328,12 +329,9 @@ export default function EnvironmentsNavbar({ environmentId, session }: Environme
|
||||
<div className="flex items-center">
|
||||
<ArrowRightOnRectangleIcon className="mr-2 h-4 w-4" />
|
||||
<button
|
||||
onClick={async () => {
|
||||
try {
|
||||
await signOut();
|
||||
} catch (error) {
|
||||
console.error("Failed to sign out:", error);
|
||||
}
|
||||
onClick={() => {
|
||||
signOut();
|
||||
setLoading(true);
|
||||
}}>
|
||||
Logout
|
||||
</button>
|
||||
|
||||
@@ -19,10 +19,10 @@ const AddEmailAlertModal: React.FC<AddEmailAlertModalProps> = ({ open, setOpen }
|
||||
];
|
||||
|
||||
const onTest = () => {
|
||||
console.log("Test button clicked!");
|
||||
throw Error("not implemented");
|
||||
};
|
||||
const onSave = () => {
|
||||
console.log("Save button clicked!");
|
||||
throw Error("not implemented");
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -33,7 +33,5 @@ export default function ApiKeyList({
|
||||
|
||||
const environmentTypeId = findEnvironmentByType(product?.environments, environmentType);
|
||||
|
||||
console.log(environmentTypeId);
|
||||
|
||||
return <EditApiKeys environmentTypeId={environmentTypeId} environmentType={environmentType} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user