Skip to content
Snippets Groups Projects
Select Git revision
  • a2cc549876b238f83bc0a4bd4c3dc51d4a5c9d22
  • renovate/django-split-settings-1.x
  • renovate/djangorestframework-3.x
  • main
  • 520-improve-trackmanager
  • 520-fix-scheduling
  • 520-akowner
  • 520-status
  • 520-message-resolved
  • 520-improve-scheduling-2
  • renovate/django-bootstrap5-24.x
  • 520-improve-submission
  • 520-improve-scheduling
  • 520-improve-wall
  • 520-fix-event-wizard-datepicker
  • 520-upgrades
  • renovate/tzdata-2023.x
  • renovate/django-5.x
  • renovate/fontawesomefree-6.x
  • renovate/sphinx-rtd-theme-2.x
  • renovate/sphinxcontrib-apidoc-0.x
21 results

manage.py

Blame
  • Forked from KIF / AKPlanning
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    useLayout.ts 821 B
    import {useEffect, useRef, useState} from "react";
    import {LayoutConfig} from "../types/LayoutConfig";
    import {LayoutService} from "../services/LayoutService";
    
    export default function useLayout(): LayoutConfig | null {
      const currentId = useRef<string | null>(null);
      const [layout, setLayout] = useState<LayoutConfig | null>(null);
    
      useEffect(() => {
        LayoutService.init().then(() => {
          const refresh = () => {
            const activeLayout = LayoutService.getActiveLayout();
    
            if(currentId.current !== activeLayout.id) {
              console.log("Switching from", currentId.current, "to", activeLayout.id)
              currentId.current = activeLayout.id;
              setLayout(activeLayout);
            }
          };
    
          window.setInterval(refresh, 10000);
          refresh();
        });
      }, []);
    
      return layout;
    }