plane/web/store/application/app-config.store.ts
Aaryan Khandelwal 577118ca02 chore: new sign-in, sign-up and forgot password workflows (#3415)
* chore: sign up workflow updated

* chore: sign in workflow updated

* refactor: folder structure

* chore: forgot password workflow

* refactor: form component props

* chore: forgot password popover for instances with smtp unconfigured

* chore: updated UX copy

* chore: update reset password link

* chore: update email placeholder
2024-01-22 13:23:10 +05:30

41 lines
944 B
TypeScript

import { observable, action, makeObservable, runInAction } from "mobx";
// types
import { IAppConfig } from "@plane/types";
// services
import { AppConfigService } from "services/app_config.service";
export interface IAppConfigStore {
// observables
envConfig: IAppConfig | null;
// actions
fetchAppConfig: () => Promise<any>;
}
export class AppConfigStore implements IAppConfigStore {
// observables
envConfig: IAppConfig | null = null;
// service
appConfigService;
constructor() {
makeObservable(this, {
// observables
envConfig: observable.ref,
// actions
fetchAppConfig: action,
});
this.appConfigService = new AppConfigService();
}
/**
* Fetches the app config from the API
*/
fetchAppConfig = async () =>
await this.appConfigService.envConfig().then((config) => {
runInAction(() => {
this.envConfig = config;
});
return config;
});
}