Skip to content

Commit

Permalink
Merge pull request #10897 from DestinyItemManager/logout
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis authored Jan 19, 2025
2 parents e34472d + a4dc036 commit b4e2eb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Next

* Restored a workaround for laggy dragging in Chrome on Windows when using some high-DPI and/or Logitech mice.
* DIM now recognizes exotic weapons that grant intrinsic breaker abilities through a perk.
* Logging out now properly "forgets" the page you were on, so when you log in again it doesn't try to go back to that page.

## 8.54.0 <span class="changelog-date">(2025-01-12)</span>

## 8.53.0 <span class="changelog-date">(2025-01-05)</span>
Expand Down
8 changes: 6 additions & 2 deletions src/app/accounts/MenuAccounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useThunkDispatch } from 'app/store/thunk-dispatch';
import { chainComparator, compareBy, reverseComparator } from 'app/utils/comparators';
import React from 'react';
import { useSelector } from 'react-redux';
import { Link } from 'react-router';
import { Link, useNavigate } from 'react-router';
import { AppIcon, signOutIcon } from '../shell/icons';
import Account from './Account';
import styles from './MenuAccounts.m.scss';
Expand All @@ -22,8 +22,12 @@ export default function MenuAccounts({
const dispatch = useThunkDispatch();
const currentAccount = useSelector(currentAccountSelector);
const accounts = useSelector(accountsSelector);
const navigate = useNavigate();

const onLogOut = () => dispatch(logOut());
const onLogOut = async () => {
await dispatch(logOut());
await navigate('/login');
};

const sortedAccounts = accounts.toSorted(
chainComparator(
Expand Down
8 changes: 6 additions & 2 deletions src/app/accounts/SelectAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppIcon, signOutIcon } from 'app/shell/icons';
import { useThunkDispatch } from 'app/store/thunk-dispatch';
import { chainComparator, compareBy, reverseComparator } from 'app/utils/comparators';
import { useSelector } from 'react-redux';
import { Link } from 'react-router';
import { Link, useNavigate } from 'react-router';
import Account from './Account';
import styles from './SelectAccount.m.scss';
import { logOut } from './platforms';
Expand All @@ -25,7 +25,11 @@ export default function SelectAccount({ path }: { path?: string }) {
const bungieName = sortedAccounts[0].displayName;

const dispatch = useThunkDispatch();
const onLogOut = () => dispatch(logOut());
const navigate = useNavigate();
const onLogOut = async () => {
await dispatch(logOut());
await navigate('/login');
};

return (
<div className={styles.accountSelect}>
Expand Down

0 comments on commit b4e2eb3

Please sign in to comment.