setting, session and profile fix
This commit is contained in:
parent
068142ed61
commit
a434af224c
34 changed files with 497 additions and 119 deletions
|
|
@ -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);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue