Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix bug on logout

fzaninotto695c973b3443
diff --git a/src/components/atomic-crm/root/ConfigurationContext.tsx b/src/components/atomic-crm/root/ConfigurationContext.tsx
index 0c9a4513..f411e5cc 100644
--- a/src/components/atomic-crm/root/ConfigurationContext.tsx
+++ b/src/components/atomic-crm/root/ConfigurationContext.tsx
@@ -1,6 +1,7 @@
import { useStore } from "ra-core";
import type { DealStage, NoteStatus } from "../types";
+import { defaultConfiguration } from "./defaultConfiguration";
export const CONFIGURATION_STORE_KEY = "app.configuration";
@@ -19,7 +20,10 @@ export interface ConfigurationContextValue {
}
export const useConfigurationContext = () => {
- const [config] = useStore<ConfigurationContextValue>(CONFIGURATION_STORE_KEY);
+ const [config] = useStore<ConfigurationContextValue>(
+ CONFIGURATION_STORE_KEY,
+ defaultConfiguration,
+ );
return config;
};
diff --git a/src/components/atomic-crm/root/defaultConfiguration.ts b/src/components/atomic-crm/root/defaultConfiguration.ts
index c79222e9..827bf1db 100644
--- a/src/components/atomic-crm/root/defaultConfiguration.ts
+++ b/src/components/atomic-crm/root/defaultConfiguration.ts
@@ -1,3 +1,5 @@
+import type { ConfigurationContextValue } from "./ConfigurationContext";
+
export const defaultDarkModeLogo = "./logos/logo_atomic_crm_dark.svg";
export const defaultLightModeLogo = "./logos/logo_atomic_crm_light.svg";
@@ -55,3 +57,15 @@ export const defaultTaskTypes = [
"Call",
];
+export const defaultConfiguration: ConfigurationContextValue = {
+ companySectors: defaultCompanySectors,
+ dealCategories: defaultDealCategories,
+ dealPipelineStatuses: defaultDealPipelineStatuses,
+ dealStages: defaultDealStages,
+ noteStatuses: defaultNoteStatuses,
+ taskTypes: defaultTaskTypes,
+ title: defaultTitle,
+ darkModeLogo: defaultDarkModeLogo,
+ lightModeLogo: defaultLightModeLogo,
+};
+