utils.tsx 349 B

123456789
  1. const SHOW_TEMPLATES_KEY = 'dashboards-show-templates';
  2. export function shouldShowTemplates(): boolean {
  3. const shouldShow = localStorage.getItem(SHOW_TEMPLATES_KEY);
  4. return shouldShow === 'true' || shouldShow === null;
  5. }
  6. export function setShowTemplates(value: boolean) {
  7. localStorage.setItem(SHOW_TEMPLATES_KEY, value ? 'true' : 'false');
  8. }