mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-25 16:13:47 +03:00
1d7bc8a5bc
* remove duplicate import * 🚧 add new linter configuration * 🧑💻 add and run prettier * 🐛 add babel parser for linter * 🧑💻 add lint-fix command * 🚨 use lint-fix * 🚨 remove 'FC' as a type. Use const and JSX.Element * 🚨 enforce arrow function rule from linter * 🔥 delete unused file * 🚨 adding /* eslint-disable */ in failing files * 💩 add ts-expect-error to Victory components
22 lines
576 B
TypeScript
22 lines
576 B
TypeScript
/* eslint-disable */
|
|
import { BrainConfig } from "../types";
|
|
|
|
const BRAIN_CONFIG_LOCAL_STORAGE_KEY = "userBrainConfig";
|
|
|
|
export const saveBrainConfigInLocalStorage = (updatedConfig: BrainConfig) => {
|
|
localStorage.setItem(
|
|
BRAIN_CONFIG_LOCAL_STORAGE_KEY,
|
|
JSON.stringify(updatedConfig)
|
|
);
|
|
};
|
|
export const getBrainConfigFromLocalStorage = (): BrainConfig | undefined => {
|
|
const persistedBrainConfig = localStorage.getItem(
|
|
BRAIN_CONFIG_LOCAL_STORAGE_KEY
|
|
);
|
|
if (persistedBrainConfig === null) {
|
|
return;
|
|
}
|
|
|
|
return JSON.parse(persistedBrainConfig);
|
|
};
|