fixed display displayName in toast

This commit is contained in:
Elyor Djalilov 2024-07-02 14:52:46 +05:00
parent 353894ccea
commit 7883f3152d
4 changed files with 6 additions and 7 deletions

View File

@ -63,7 +63,7 @@ const LogoutAllSessionDialog = ({
: onLogoutAllSessions(t);
onClose();
} else {
onLogoutAllExceptThis(t, exceptId);
onLogoutAllExceptThis(t, exceptId, displayName);
onClose();
}
};

View File

@ -34,6 +34,7 @@ const Wrapper = styled.div`
const AllSessionsBlock = (props) => {
const { t, isLoading, items, onClickLogoutAllExceptThis } = props;
const { displayName } = items;
const exceptId = items.connections[0]?.id;
const sessions = items.sessions || items.connections;
@ -51,7 +52,7 @@ const AllSessionsBlock = (props) => {
<Button
label={t("Profile:LogoutFromAllSessions")}
size="small"
onClick={() => onClickLogoutAllExceptThis(t, exceptId)}
onClick={() => onClickLogoutAllExceptThis(t, exceptId, displayName)}
scale={true}
isLoading={isLoading}
/>

View File

@ -140,8 +140,6 @@ const Sessions = ({
? [bufferSelection.id, ...userIdsFromSelection]
: [...userIdsFromSelection];
console.log(allSessions);
if (!isSessionsLoaded) return <SessionsLoader viewAs={viewAs} />;
return (

View File

@ -702,7 +702,7 @@ class SelectionStore {
}
};
onClickLogoutAllExceptThis = async (t, sessionId) => {
onClickLogoutAllExceptThis = async (t, sessionId, displayName) => {
const { removeAllExceptThisEventId } = this.settingsSetupStore;
const bufferSelection = this.bufferSelection?.connections[0]?.id;
@ -711,7 +711,7 @@ class SelectionStore {
if (!exceptSessionId)
return toastr.error(
t("Settings:UserAlreadyLoggedOut", { displayName: this.displayName }),
t("Settings:UserAlreadyLoggedOut", { displayName: displayName }),
);
try {
@ -733,7 +733,7 @@ class SelectionStore {
toastr.success(
t("Settings:LoggedOutByUserExceptThis", {
displayName: this.displayName,
displayName: displayName,
}),
);
} catch (error) {