Rename action.reload -> action.background

merge-requests/460/head
Alex Gleason 2021-03-30 00:45:23 -05:00
rodzic 15d61a98e7
commit 73a3ee296b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -190,8 +190,8 @@ export function logOut() {
};
}
export function switchAccount(accountId, reload = true) {
return { type: SWITCH_ACCOUNT, accountId, reload };
export function switchAccount(accountId, background = false) {
return { type: SWITCH_ACCOUNT, accountId, background };
}
export function fetchOwnAccounts() {

Wyświetl plik

@ -66,7 +66,7 @@ class ProfileDropdown extends React.PureComponent {
handleMiddleClick = account => {
return e => {
this.props.dispatch(switchAccount(account.get('id'), false));
this.props.dispatch(switchAccount(account.get('id'), true));
window.open('/', '_blank', 'noopener,noreferrer');
e.preventDefault();
};

Wyświetl plik

@ -154,7 +154,6 @@ const userSwitched = (oldState, state) => {
};
const maybeReload = (oldState, state, action) => {
if (action.reload === false) return;
if (userSwitched(oldState, state)) {
reload(state);
}
@ -167,7 +166,9 @@ export default function auth(oldState = initialState, action) {
// Persist the state in localStorage
persistAuth(state);
if (action.reload === false) {
// When middle-clicking a profile, we want to save the
// user in localStorage, but not update the reducer
if (action.background === true) {
return oldState;
}