mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: resolved build errors
This commit is contained in:
parent
33953b2c5f
commit
77e38b6124
@ -19,7 +19,7 @@ const authService = new AuthService();
|
||||
export const SidebarDropdown = observer(() => {
|
||||
// store hooks
|
||||
const { isSidebarCollapsed } = useTheme();
|
||||
const { currentUser } = useUser();
|
||||
const { currentUser, signOut } = useUser();
|
||||
// hooks
|
||||
const { resolvedTheme, setTheme } = useNextTheme();
|
||||
// state
|
||||
@ -30,6 +30,8 @@ export const SidebarDropdown = observer(() => {
|
||||
setTheme(newTheme);
|
||||
};
|
||||
|
||||
const handleSignOut = () => signOut();
|
||||
|
||||
useEffect(() => {
|
||||
if (csrfToken === undefined)
|
||||
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
|
||||
@ -95,7 +97,7 @@ export const SidebarDropdown = observer(() => {
|
||||
</Menu.Item>
|
||||
</div>
|
||||
<div className="py-2">
|
||||
<form method="POST" action={`${API_BASE_URL}/api/instances/admins/sign-out/`}>
|
||||
<form method="POST" action={`${API_BASE_URL}/api/instances/admins/sign-out/`} onSubmit={handleSignOut}>
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value={csrfToken} />
|
||||
<Menu.Item
|
||||
as="button"
|
||||
|
@ -3,11 +3,10 @@ import { IUser } from "@plane/types";
|
||||
// helpers
|
||||
import { EUserStatus, TUserStatus } from "@/helpers";
|
||||
// services
|
||||
import { UserService } from "services/user.service";
|
||||
import { UserService } from "@/services/user.service";
|
||||
// root store
|
||||
import { RootStore } from "@/store/root-store";
|
||||
import { AuthService } from "@/services";
|
||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||
|
||||
export interface IUserStore {
|
||||
// observables
|
||||
@ -79,7 +78,6 @@ export class UserStore implements IUserStore {
|
||||
};
|
||||
|
||||
signOut = async () => {
|
||||
await this.authService.signOut(API_BASE_URL);
|
||||
this.rootStore.resetOnSignOut();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user