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