Skip to content
Snippets Groups Projects
Select Git revision
  • 6ad0b9f9d06a09226fbb5853b60b5022c0415323
  • main default protected
  • feature/export-filtering
  • feature/clear-schedule-button
  • fix/responsive-cols-in-polls
  • feature/preference-polling-form
  • feature/json-export-via-rest-framework
  • feature/json-schedule-import-tests
  • fix/add-room-import-only-once
  • ak-import
  • renovate/django-simple-history-3.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-5.x
  • renovate/mysqlclient-2.x
14 results

apps.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;
    }