mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-27 18:10:58 +00:00
Change reblog button to immediately show the interaction modal when logged out (#36138)
This commit is contained in:
parent
41ab10f88c
commit
d1402af0b2
|
|
@ -97,11 +97,7 @@ export const StatusBoostButton: FC<ReblogButtonProps> = ({
|
|||
highlighted: wasBoosted,
|
||||
disabled: boostItem.disabled,
|
||||
action: (event) => {
|
||||
if (isLoggedIn) {
|
||||
dispatch(toggleReblog(statusId, event.shiftKey));
|
||||
} else {
|
||||
showLoginPrompt();
|
||||
}
|
||||
dispatch(toggleReblog(statusId, event.shiftKey));
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -112,33 +108,22 @@ export const StatusBoostButton: FC<ReblogButtonProps> = ({
|
|||
icon: quoteItem.iconComponent,
|
||||
disabled: quoteItem.disabled,
|
||||
action: () => {
|
||||
if (isLoggedIn) {
|
||||
dispatch(quoteComposeById(statusId));
|
||||
} else {
|
||||
showLoginPrompt();
|
||||
}
|
||||
dispatch(quoteComposeById(statusId));
|
||||
},
|
||||
},
|
||||
] satisfies [ActionMenuItemWithIcon, ActionMenuItemWithIcon];
|
||||
}, [
|
||||
dispatch,
|
||||
intl,
|
||||
isLoggedIn,
|
||||
showLoginPrompt,
|
||||
statusId,
|
||||
statusState,
|
||||
wasBoosted,
|
||||
]);
|
||||
}, [dispatch, intl, statusId, statusState, wasBoosted]);
|
||||
|
||||
const boostIcon = items[0].icon;
|
||||
|
||||
const handleDropdownOpen = useCallback(
|
||||
(event: MouseEvent | KeyboardEvent) => {
|
||||
if (!isLoggedIn) {
|
||||
showLoginPrompt();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.shiftKey) {
|
||||
if (!isLoggedIn) {
|
||||
showLoginPrompt();
|
||||
return false;
|
||||
}
|
||||
dispatch(toggleReblog(status.get('id'), true));
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user