utils.tsx 482 B

123456789101112
  1. import localStorage from 'sentry/utils/localStorage';
  2. // TODO(nikkikapadia): delete this file and move contents to index.tsx
  3. export const SHOW_TEMPLATES_KEY = 'dashboards-show-templates';
  4. export function shouldShowTemplates(): boolean {
  5. const shouldShow = localStorage.getItem(SHOW_TEMPLATES_KEY);
  6. return shouldShow === 'true' || shouldShow === null;
  7. }
  8. export function setShowTemplates(value: boolean) {
  9. localStorage.setItem(SHOW_TEMPLATES_KEY, value ? 'true' : 'false');
  10. }