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 = () => {
|
||||
return props.data?.position;
|
||||
};
|
||||
const openCustomZap = props.data?.openCustomZap || (() => {});
|
||||
const openReactions = props.data?.openReactions || (() => {});
|
||||
|
||||
createEffect(() => {
|
||||
if(!context) return;
|
||||
@ -163,7 +161,7 @@ const NoteContextMenu: Component<{
|
||||
{
|
||||
label: intl.formatMessage(tActions.noteContext.reactions),
|
||||
action: () => {
|
||||
openReactions();
|
||||
props.data?.openReactions && props.data?.openReactions();
|
||||
props.onClose()
|
||||
},
|
||||
icon: 'heart',
|
||||
@ -171,7 +169,7 @@ const NoteContextMenu: Component<{
|
||||
{
|
||||
label: intl.formatMessage(tActions.noteContext.zap),
|
||||
action: () => {
|
||||
openCustomZap();
|
||||
props.data?.openCustomZap && props.data?.openCustomZap();
|
||||
props.onClose()
|
||||
},
|
||||
icon: 'feed_zap',
|
||||
|
@ -109,12 +109,17 @@ export const AppProvider = (props: { children: JSXElement }) => {
|
||||
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({
|
||||
note,
|
||||
position,
|
||||
openCustomZapModal,
|
||||
openReactionModal,
|
||||
openCustomZap,
|
||||
openReactions,
|
||||
}))
|
||||
updateStore('showNoteContextMenu', () => true);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user