@agenticmail/enterprise 0.5.306 → 0.5.307
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/dashboard/app.js
CHANGED
|
@@ -313,17 +313,19 @@ function App() {
|
|
|
313
313
|
}, []);
|
|
314
314
|
|
|
315
315
|
const stopImpersonation = useCallback(() => {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
setImpersonating(prev => {
|
|
317
|
+
if (prev && prev.originalToken) {
|
|
318
|
+
localStorage.setItem('em_token', prev.originalToken);
|
|
319
|
+
}
|
|
320
|
+
return null;
|
|
321
|
+
});
|
|
320
322
|
localStorage.removeItem('em_client_org_id');
|
|
321
323
|
// Reload real user
|
|
322
324
|
authCall('/me').then(d => { setUser(d.user || d); }).catch(() => {});
|
|
323
325
|
apiCall('/me/permissions').then(d => { if (d && d.permissions) setPermissions(d.permissions); }).catch(() => {});
|
|
324
326
|
toast('Stopped impersonation', 'success');
|
|
325
327
|
setPage('users');
|
|
326
|
-
}, [
|
|
328
|
+
}, []);
|
|
327
329
|
|
|
328
330
|
return h(AppContext.Provider, { value: { toast, toasts, user, theme, setPage, permissions, impersonating, startImpersonation, stopImpersonation } },
|
|
329
331
|
h('div', { className: 'app-layout' },
|
|
@@ -28,13 +28,8 @@ export function OrgContextSwitcher(props) {
|
|
|
28
28
|
var list = d.organizations || [];
|
|
29
29
|
setOrgs(list);
|
|
30
30
|
setLoaded(true);
|
|
31
|
-
// Auto-select user's org on first load if org-bound
|
|
32
|
-
if (userOrgId && !selectedOrgId) {
|
|
33
|
-
var org = list.find(function(o) { return o.id === userOrgId; });
|
|
34
|
-
if (org) onOrgChange(userOrgId, org);
|
|
35
|
-
}
|
|
36
31
|
}).catch(function() { setLoaded(true); });
|
|
37
|
-
}, [
|
|
32
|
+
}, []);
|
|
38
33
|
|
|
39
34
|
// Don't render if no client orgs and user isn't org-bound
|
|
40
35
|
if (loaded && orgs.length === 0 && !userOrgId) return null;
|
package/package.json
CHANGED
package/src/dashboard/app.js
CHANGED
|
@@ -313,17 +313,19 @@ function App() {
|
|
|
313
313
|
}, []);
|
|
314
314
|
|
|
315
315
|
const stopImpersonation = useCallback(() => {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
setImpersonating(prev => {
|
|
317
|
+
if (prev && prev.originalToken) {
|
|
318
|
+
localStorage.setItem('em_token', prev.originalToken);
|
|
319
|
+
}
|
|
320
|
+
return null;
|
|
321
|
+
});
|
|
320
322
|
localStorage.removeItem('em_client_org_id');
|
|
321
323
|
// Reload real user
|
|
322
324
|
authCall('/me').then(d => { setUser(d.user || d); }).catch(() => {});
|
|
323
325
|
apiCall('/me/permissions').then(d => { if (d && d.permissions) setPermissions(d.permissions); }).catch(() => {});
|
|
324
326
|
toast('Stopped impersonation', 'success');
|
|
325
327
|
setPage('users');
|
|
326
|
-
}, [
|
|
328
|
+
}, []);
|
|
327
329
|
|
|
328
330
|
return h(AppContext.Provider, { value: { toast, toasts, user, theme, setPage, permissions, impersonating, startImpersonation, stopImpersonation } },
|
|
329
331
|
h('div', { className: 'app-layout' },
|
|
@@ -28,13 +28,8 @@ export function OrgContextSwitcher(props) {
|
|
|
28
28
|
var list = d.organizations || [];
|
|
29
29
|
setOrgs(list);
|
|
30
30
|
setLoaded(true);
|
|
31
|
-
// Auto-select user's org on first load if org-bound
|
|
32
|
-
if (userOrgId && !selectedOrgId) {
|
|
33
|
-
var org = list.find(function(o) { return o.id === userOrgId; });
|
|
34
|
-
if (org) onOrgChange(userOrgId, org);
|
|
35
|
-
}
|
|
36
31
|
}).catch(function() { setLoaded(true); });
|
|
37
|
-
}, [
|
|
32
|
+
}, []);
|
|
38
33
|
|
|
39
34
|
// Don't render if no client orgs and user isn't org-bound
|
|
40
35
|
if (loaded && orgs.length === 0 && !userOrgId) return null;
|