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(() => {
|
export const SidebarDropdown = observer(() => {
|
||||||
// store hooks
|
// store hooks
|
||||||
const { isSidebarCollapsed } = useTheme();
|
const { isSidebarCollapsed } = useTheme();
|
||||||
const { currentUser } = useUser();
|
const { currentUser, signOut } = useUser();
|
||||||
// hooks
|
// hooks
|
||||||
const { resolvedTheme, setTheme } = useNextTheme();
|
const { resolvedTheme, setTheme } = useNextTheme();
|
||||||
// state
|
// state
|
||||||
@ -30,6 +30,8 @@ export const SidebarDropdown = observer(() => {
|
|||||||
setTheme(newTheme);
|
setTheme(newTheme);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSignOut = () => signOut();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (csrfToken === undefined)
|
if (csrfToken === undefined)
|
||||||
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
|
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
|
||||||
@ -95,7 +97,7 @@ export const SidebarDropdown = observer(() => {
|
|||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</div>
|
</div>
|
||||||
<div className="py-2">
|
<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} />
|
<input type="hidden" name="csrfmiddlewaretoken" value={csrfToken} />
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
as="button"
|
as="button"
|
||||||
|
@ -3,11 +3,10 @@ import { IUser } from "@plane/types";
|
|||||||
// helpers
|
// helpers
|
||||||
import { EUserStatus, TUserStatus } from "@/helpers";
|
import { EUserStatus, TUserStatus } from "@/helpers";
|
||||||
// services
|
// services
|
||||||
import { UserService } from "services/user.service";
|
import { UserService } from "@/services/user.service";
|
||||||
// root store
|
// root store
|
||||||
import { RootStore } from "@/store/root-store";
|
import { RootStore } from "@/store/root-store";
|
||||||
import { AuthService } from "@/services";
|
import { AuthService } from "@/services";
|
||||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
|
||||||
|
|
||||||
export interface IUserStore {
|
export interface IUserStore {
|
||||||
// observables
|
// observables
|
||||||
@ -79,7 +78,6 @@ export class UserStore implements IUserStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
signOut = async () => {
|
signOut = async () => {
|
||||||
await this.authService.signOut(API_BASE_URL);
|
|
||||||
this.rootStore.resetOnSignOut();
|
this.rootStore.resetOnSignOut();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user