Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forget previous path when explicitly logging out #10897

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading