prevent click through to comment on notification click

This commit is contained in:
keyan 2021-10-30 14:19:49 -05:00
parent da668106a3
commit 6dfbd1d1ce
2 changed files with 14 additions and 12 deletions

View File

@ -91,28 +91,26 @@ export default function UpVote ({ item, className }) {
<LongPressable <LongPressable
onLongPress={ onLongPress={
async (e) => { async (e) => {
e.preventDefault()
e.stopPropagation() e.stopPropagation()
if (!item || voteLock) return if (!item || voteLock) return
console.log('hi1')
// we can't tip ourselves // we can't tip ourselves
if (noSelfTips) { if (noSelfTips) {
return return
} }
if (window.getSelection) {
window.getSelection().removeAllRanges()
} else if (document.selection) {
document.selection.empty()
}
setItem({ itemId: item.id, act, strike }) setItem({ itemId: item.id, act, strike })
} }
} }
onShortPress={ onShortPress={
me me
? async (e) => { ? async (e) => {
e.preventDefault()
e.stopPropagation() e.stopPropagation()
if (!item || voteLock) return if (!item || voteLock) return
console.log('hi2')
// we can't tip ourselves // we can't tip ourselves
if (noSelfTips) { if (noSelfTips) {
@ -152,16 +150,18 @@ export default function UpVote ({ item, className }) {
} }
> >
<ActionTooltip notForm disable={noSelfTips} overlayText={overlayText()}> <ActionTooltip notForm disable={noSelfTips} overlayText={overlayText()}>
<UpArrow <UpArrow
width={24} width={24}
height={24} height={24}
className={ className={
`${styles.upvote} `${styles.upvote}
${className || ''} ${className || ''}
${noSelfTips ? styles.noSelfTips : ''} ${noSelfTips ? styles.noSelfTips : ''}
${item?.meVote ? styles.voted : ''}` ${item?.meVote ? styles.voted : ''}`
} }
onClick={e => {
e.stopPropagation()
}}
/> />
</ActionTooltip> </ActionTooltip>
</LongPressable>} </LongPressable>}

View File

@ -1,6 +1,8 @@
.upvote { .upvote {
fill: grey; fill: grey;
user-select: none; user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
} }
.upvote:hover { .upvote:hover {