@carlonicora/nextjs-jsonapi 3.8.1 → 3.8.2
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.
- package/dist/{BlockNoteEditor-KXONPDJR.mjs → BlockNoteEditor-34AZITDR.mjs} +2 -2
- package/dist/{BlockNoteEditor-55FMZZOR.js → BlockNoteEditor-KRGDA5RX.js} +9 -9
- package/dist/{BlockNoteEditor-55FMZZOR.js.map → BlockNoteEditor-KRGDA5RX.js.map} +1 -1
- package/dist/billing/index.js +333 -333
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-SJ3EW2FD.js → chunk-DGAVM2LZ.js} +10 -3
- package/dist/chunk-DGAVM2LZ.js.map +1 -0
- package/dist/{chunk-YOYYVEEY.mjs → chunk-GXSXD4OR.mjs} +11 -4
- package/dist/chunk-GXSXD4OR.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/user/contexts/CurrentUserContext.tsx +24 -0
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +40 -0
- package/dist/chunk-SJ3EW2FD.js.map +0 -1
- package/dist/chunk-YOYYVEEY.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-KXONPDJR.mjs.map → BlockNoteEditor-34AZITDR.mjs.map} +0 -0
|
@@ -7662,6 +7662,7 @@ import { useTranslations as useTranslations41 } from "next-intl";
|
|
|
7662
7662
|
import { Fragment as Fragment19, createContext as createContext16, useContext as useContext17, useState as useState36 } from "react";
|
|
7663
7663
|
|
|
7664
7664
|
// src/features/user/contexts/CurrentUserContext.tsx
|
|
7665
|
+
import { getCookie } from "cookies-next";
|
|
7665
7666
|
import { useAtom } from "jotai";
|
|
7666
7667
|
import { atomWithStorage } from "jotai/utils";
|
|
7667
7668
|
import { usePathname } from "next/navigation";
|
|
@@ -7818,6 +7819,12 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
7818
7819
|
const { socket, isConnected } = useSocketContext();
|
|
7819
7820
|
const refreshUserRef = useRef10(refreshUser);
|
|
7820
7821
|
refreshUserRef.current = refreshUser;
|
|
7822
|
+
useEffect9(() => {
|
|
7823
|
+
if (typeof window === "undefined") return;
|
|
7824
|
+
if (window.localStorage.getItem(CURRENT_USER_STORAGE_KEY)) return;
|
|
7825
|
+
if (!getCookie("token")) return;
|
|
7826
|
+
void refreshUserRef.current({ skipCookieUpdate: true });
|
|
7827
|
+
}, []);
|
|
7821
7828
|
const isRefreshingRef = useRef10(false);
|
|
7822
7829
|
useEffect9(() => {
|
|
7823
7830
|
if (!socket || !isConnected || !currentUser?.company?.id) {
|
|
@@ -10343,7 +10350,7 @@ import { useRef as useRef17 } from "react";
|
|
|
10343
10350
|
import dynamic from "next/dynamic";
|
|
10344
10351
|
import React18 from "react";
|
|
10345
10352
|
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
10346
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10353
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-34AZITDR.mjs"), {
|
|
10347
10354
|
ssr: false
|
|
10348
10355
|
});
|
|
10349
10356
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -19406,7 +19413,7 @@ function Logout({ storageKeys }) {
|
|
|
19406
19413
|
__name(Logout, "Logout");
|
|
19407
19414
|
|
|
19408
19415
|
// src/features/auth/components/forms/RefreshUser.tsx
|
|
19409
|
-
import { deleteCookie, getCookie } from "cookies-next";
|
|
19416
|
+
import { deleteCookie, getCookie as getCookie2 } from "cookies-next";
|
|
19410
19417
|
import { useEffect as useEffect60 } from "react";
|
|
19411
19418
|
function RefreshUser() {
|
|
19412
19419
|
const { setUser } = useCurrentUserContext();
|
|
@@ -19428,7 +19435,7 @@ function RefreshUser() {
|
|
|
19428
19435
|
}
|
|
19429
19436
|
}, "loadFullUser");
|
|
19430
19437
|
useEffect60(() => {
|
|
19431
|
-
const reloadData =
|
|
19438
|
+
const reloadData = getCookie2("reloadData");
|
|
19432
19439
|
if (reloadData !== void 0) loadFullUser();
|
|
19433
19440
|
}, []);
|
|
19434
19441
|
return null;
|
|
@@ -25649,4 +25656,4 @@ export {
|
|
|
25649
25656
|
useOAuthClients,
|
|
25650
25657
|
useOAuthClient
|
|
25651
25658
|
};
|
|
25652
|
-
//# sourceMappingURL=chunk-
|
|
25659
|
+
//# sourceMappingURL=chunk-GXSXD4OR.mjs.map
|