jclib-ui 0.0.92 → 0.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21342,6 +21342,7 @@ const Container = styled.div`
21342
21342
  }
21343
21343
  `;
21344
21344
  function CheckUpdates() {
21345
+ const showRef = useRef();
21345
21346
  function checkUpdate() {
21346
21347
  console.info("App:", window.location.origin);
21347
21348
  if ("serviceWorker" in navigator && window.location.origin.startsWith("http")) {
@@ -21372,12 +21373,12 @@ function CheckUpdates() {
21372
21373
  }
21373
21374
  }
21374
21375
  function setShow(show) {
21375
- const el = document.querySelector("#update-box");
21376
- if (el) {
21376
+ var _a, _b;
21377
+ if (showRef == null ? void 0 : showRef.current) {
21377
21378
  if (show) {
21378
- el.classList.add("update-show");
21379
+ (_a = showRef.current) == null ? void 0 : _a.classList.add("update-show");
21379
21380
  } else {
21380
- el.classList.remove("update-show");
21381
+ (_b = showRef.current) == null ? void 0 : _b.classList.remove("update-show");
21381
21382
  }
21382
21383
  } else {
21383
21384
  console.info("Não encontrou box update!");
@@ -21390,7 +21391,7 @@ function CheckUpdates() {
21390
21391
  useLayoutEffect(() => {
21391
21392
  checkUpdate();
21392
21393
  }, []);
21393
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { onClick: handleClick, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: "update-box", className: "update-box", children: [
21394
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { onClick: handleClick, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: showRef, className: "update-box", children: [
21394
21395
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "update-line" }),
21395
21396
  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "fas fa-info-circle" }),
21396
21397
  "Nova versão disponível, atualizando..."