import { session } from "./tool";
export const closeApp = () => {
  window.close();
};

export const saveTemporaryImgViewConfig = (routePath: string, val: any) => {
  let obj = session.get("temporaryImgViewConfig") || {};
  obj[routePath] = val;
  session.set("temporaryImgViewConfig", obj);
};
export const getTemporaryImgViewConfig = (routePath: string) => {
  let obj = session.get("temporaryImgViewConfig") || {};
  return obj[routePath];
};

export const getTextAreaRows = (str: string) => {
  let num = 0;
  str.split("\n").forEach(() => {
    num++;
  });
  return num;
};
