@streamoid/settings 0.22.1 → 0.22.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/index.js CHANGED
@@ -17244,11 +17244,13 @@ function SettingsContentInner({
17244
17244
  return true;
17245
17245
  };
17246
17246
  (0, import_react29.useEffect)(() => {
17247
- if (workspaceList.length > 0 && localWorkspaces === null) {
17248
- setLocalWorkspaces(workspaceList.map(toWorkspaceData));
17249
- }
17250
- }, [workspaceList, localWorkspaces]);
17251
- const displayWorkspaces = localWorkspaces !== null ? localWorkspaces.map(toWorkspaceInfo) : workspaceList;
17247
+ setLocalWorkspaces(null);
17248
+ }, [workspaceId]);
17249
+ const displayWorkspaces = (localWorkspaces ?? workspaceList.map(toWorkspaceData)).map(
17250
+ (ws) => toWorkspaceInfo(
17251
+ workspaceId ? { ...ws, isCurrent: ws.id === workspaceId } : ws
17252
+ )
17253
+ );
17252
17254
  const currentWorkspaceInfo = displayWorkspaces.find((ws) => ws.isCurrent) ?? null;
17253
17255
  const currentWorkspaceData = currentWorkspaceInfo ? {
17254
17256
  ...toWorkspaceData(currentWorkspaceInfo),
package/dist/index.mjs CHANGED
@@ -17128,11 +17128,13 @@ function SettingsContentInner({
17128
17128
  return true;
17129
17129
  };
17130
17130
  useEffect21(() => {
17131
- if (workspaceList.length > 0 && localWorkspaces === null) {
17132
- setLocalWorkspaces(workspaceList.map(toWorkspaceData));
17133
- }
17134
- }, [workspaceList, localWorkspaces]);
17135
- const displayWorkspaces = localWorkspaces !== null ? localWorkspaces.map(toWorkspaceInfo) : workspaceList;
17131
+ setLocalWorkspaces(null);
17132
+ }, [workspaceId]);
17133
+ const displayWorkspaces = (localWorkspaces ?? workspaceList.map(toWorkspaceData)).map(
17134
+ (ws) => toWorkspaceInfo(
17135
+ workspaceId ? { ...ws, isCurrent: ws.id === workspaceId } : ws
17136
+ )
17137
+ );
17136
17138
  const currentWorkspaceInfo = displayWorkspaces.find((ws) => ws.isCurrent) ?? null;
17137
17139
  const currentWorkspaceData = currentWorkspaceInfo ? {
17138
17140
  ...toWorkspaceData(currentWorkspaceInfo),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -32,6 +32,7 @@
32
32
  "@types/react-dom": "^19.0.0",
33
33
  "@streamoid/icons": "*",
34
34
  "@streamoid/ui": "*",
35
+ "jsdom": "^29.1.1",
35
36
  "react": "^19.0.0",
36
37
  "react-dom": "^19.0.0",
37
38
  "tsup": "^8.0.0",