mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Fix custom zap opening from context
This commit is contained in:
parent
e287eac150
commit
1533d45000
@ -45,8 +45,6 @@ const NoteContextMenu: Component<{
|
|||||||
const position = () => {
|
const position = () => {
|
||||||
return props.data?.position;
|
return props.data?.position;
|
||||||
};
|
};
|
||||||
const openCustomZap = props.data?.openCustomZap || (() => {});
|
|
||||||
const openReactions = props.data?.openReactions || (() => {});
|
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if(!context) return;
|
if(!context) return;
|
||||||
@ -163,7 +161,7 @@ const NoteContextMenu: Component<{
|
|||||||
{
|
{
|
||||||
label: intl.formatMessage(tActions.noteContext.reactions),
|
label: intl.formatMessage(tActions.noteContext.reactions),
|
||||||
action: () => {
|
action: () => {
|
||||||
openReactions();
|
props.data?.openReactions && props.data?.openReactions();
|
||||||
props.onClose()
|
props.onClose()
|
||||||
},
|
},
|
||||||
icon: 'heart',
|
icon: 'heart',
|
||||||
@ -171,7 +169,7 @@ const NoteContextMenu: Component<{
|
|||||||
{
|
{
|
||||||
label: intl.formatMessage(tActions.noteContext.zap),
|
label: intl.formatMessage(tActions.noteContext.zap),
|
||||||
action: () => {
|
action: () => {
|
||||||
openCustomZap();
|
props.data?.openCustomZap && props.data?.openCustomZap();
|
||||||
props.onClose()
|
props.onClose()
|
||||||
},
|
},
|
||||||
icon: 'feed_zap',
|
icon: 'feed_zap',
|
||||||
|
@ -109,12 +109,17 @@ export const AppProvider = (props: { children: JSXElement }) => {
|
|||||||
updateStore('showCustomZapModal', () => false);
|
updateStore('showCustomZapModal', () => false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openContextMenu = (note: PrimalNote, position: DOMRect | undefined, openCustomZapModal: () => void, openReactionModal: () => void) => {
|
const openContextMenu = (
|
||||||
|
note: PrimalNote,
|
||||||
|
position: DOMRect | undefined,
|
||||||
|
openCustomZap: () => void,
|
||||||
|
openReactions: () => void,
|
||||||
|
) => {
|
||||||
updateStore('noteContextMenuInfo', reconcile({
|
updateStore('noteContextMenuInfo', reconcile({
|
||||||
note,
|
note,
|
||||||
position,
|
position,
|
||||||
openCustomZapModal,
|
openCustomZap,
|
||||||
openReactionModal,
|
openReactions,
|
||||||
}))
|
}))
|
||||||
updateStore('showNoteContextMenu', () => true);
|
updateStore('showNoteContextMenu', () => true);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user