Skip to content

Commit

Permalink
fix: lint & format
Browse files Browse the repository at this point in the history
  • Loading branch information
qamarq committed Nov 20, 2024
1 parent 44b134c commit 0da4b57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @eslint-community/eslint-comments/disable-enable-pair */

/* eslint-disable react/prop-types */
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
Expand Down
21 changes: 9 additions & 12 deletions frontend/src/components/ui/signout-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair

/* eslint-disable @typescript-eslint/no-misused-promises */
"use client";

import { Slot } from "@radix-ui/react-slot";
Expand All @@ -9,9 +6,6 @@ import type React from "react";
import { signOutFunction } from "@/actions/logout";
import { Button } from "@/components/ui/button";

// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-misused-promises */

export function SignOutButton({
children,
asChild = false,
Expand All @@ -20,14 +14,17 @@ export function SignOutButton({
asChild?: boolean;
}) {
if (asChild) {
const signOut = async () => {
await signOutFunction();
// refresh
window.location.reload();
};
return (
<Slot
className="w-full"
onClick={async (e) => {
onClick={(e) => {
e.preventDefault();
await signOutFunction();
// refresh
window.location.reload();
void signOut();
}}
>
{children}
Expand All @@ -36,8 +33,8 @@ export function SignOutButton({
}
return (
<form
action={async () => {
await signOutFunction();
action={() => {
void signOutFunction();
}}
>
<Button type="submit">{children}</Button>
Expand Down

0 comments on commit 0da4b57

Please sign in to comment.