setting, session and profile fix

This commit is contained in:
debu-2 2026-10-07 06:16:26 +05:30
parent 068142ed61
commit a434af224c
34 changed files with 497 additions and 119 deletions

View file

@ -29,10 +29,9 @@ import {
import { useCallback, useEffect, useState } from "react";
import { getCurrentAccount, getMyCompanyDomain } from "../api";
import {
AUTH_ACCOUNT_KEY,
AUTH_TOKEN_KEY,
clearSession,
getAccessToken,
saveStoredAccount,
} from "../auth";
import Brand from "./Brand";
import MobileChrome from "./MobileChrome";
@ -148,7 +147,7 @@ export default function DashboardPage() {
getCurrentAccount(token)
.then(async (currentAccount) => {
sessionStorage.setItem(AUTH_ACCOUNT_KEY, JSON.stringify(currentAccount));
saveStoredAccount(currentAccount);
setAccount(currentAccount);
setMustChangePassword(Boolean(currentAccount.must_change_password));
if (currentAccount.account_type === "company" && currentAccount.is_domain_owner) {
@ -282,7 +281,7 @@ export default function DashboardPage() {
function updateAccount(next) {
setAccount(next);
sessionStorage.setItem("agmail_account", JSON.stringify(next));
saveStoredAccount(next);
}
function openExternalThread(threadId) {
@ -624,7 +623,7 @@ export default function DashboardPage() {
onComplete={(updated) => {
setAccount(updated);
setMustChangePassword(false);
sessionStorage.setItem("agmail_account", JSON.stringify(updated));
saveStoredAccount(updated);
}}
/>
)}