import storage from "./storage";
export const setKeyOpenChildWindow = async (key: string, bool: boolean) => {
  const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string)
  openChildWindow[key] = bool;
  if (key === 'shareScreenWindow' && !bool) {
    for (const k in openChildWindow) {
      openChildWindow[k] = false
    }
  }
  storage.setItem('openChildWindow', JSON.stringify(openChildWindow))
};
export const getKeyOpenChildWindow = async (key: string): Promise<boolean> => {
  const openChildWindow = await JSON.parse(storage.getItem('openChildWindow') as string)
  return openChildWindow[key]
};
