package de.assecutor.votianlt.util;

import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.applayout.AppLayout;

public class Util {
    public static void changeDrawerState(boolean drawerState) {
        AppLayout appLayout = (AppLayout) UI.getCurrent().getChildren().filter(AppLayout.class::isInstance).findFirst()
                .orElse(null);

        if (appLayout != null) {
            appLayout.setDrawerOpened(drawerState);
        }
    }
}
