Merge branch 'emoji-button-unauthorized' into 'develop'
Show unauthorized modal when touching emoji button if unauthorized See merge request soapbox-pub/soapbox!1848
This commit is contained in:
commit
df7f2d4dca
|
@ -83,10 +83,7 @@ const EmojiButtonWrapper: React.FC<IEmojiButtonWrapper> = ({ statusId, children
|
|||
if (ownAccount) {
|
||||
dispatch(simpleEmojiReact(status, emoji));
|
||||
} else {
|
||||
dispatch(openModal('UNAUTHORIZED', {
|
||||
action: 'FAVOURITE',
|
||||
ap_id: status.url,
|
||||
}));
|
||||
handleUnauthorized();
|
||||
}
|
||||
|
||||
setVisible(false);
|
||||
|
@ -96,11 +93,15 @@ const EmojiButtonWrapper: React.FC<IEmojiButtonWrapper> = ({ statusId, children
|
|||
const meEmojiReact = getReactForStatus(status, soapboxConfig.allowedEmoji) || '👍';
|
||||
|
||||
if (isUserTouching()) {
|
||||
if (ownAccount) {
|
||||
if (visible) {
|
||||
handleReact(meEmojiReact);
|
||||
} else {
|
||||
setVisible(true);
|
||||
}
|
||||
} else {
|
||||
handleUnauthorized();
|
||||
}
|
||||
} else {
|
||||
handleReact(meEmojiReact);
|
||||
}
|
||||
|
@ -109,6 +110,13 @@ const EmojiButtonWrapper: React.FC<IEmojiButtonWrapper> = ({ statusId, children
|
|||
e.stopPropagation();
|
||||
};
|
||||
|
||||
const handleUnauthorized = () => {
|
||||
dispatch(openModal('UNAUTHORIZED', {
|
||||
action: 'FAVOURITE',
|
||||
ap_id: status.url,
|
||||
}));
|
||||
};
|
||||
|
||||
// const handleUnfocus: React.EventHandler<React.KeyboardEvent> = () => {
|
||||
// setFocused(false);
|
||||
// };
|
||||
|
|
Loading…
Reference in New Issue