mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 20:19:14 +00:00
Spacing & undefined variables
This commit is contained in:
@@ -302,7 +302,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
}, (func, args) => {
|
}, (func, args) => {
|
||||||
const [proto] = args;
|
const [proto] = args;
|
||||||
if (proto.templateMessage?.hydratedTemplate) {
|
if (proto.templateMessage?.hydratedTemplate) {
|
||||||
return func(proto.templateMessage.hydratedTemplate);
|
return func(proto.templateMessage.hydratedTemplate);
|
||||||
}
|
}
|
||||||
return func(...args);
|
return func(...args);
|
||||||
});
|
});
|
||||||
@@ -365,34 +365,34 @@ exports.LoadUtils = () => {
|
|||||||
returnObject.hydratedButtons = buttonsOptions.buttons;
|
returnObject.hydratedButtons = buttonsOptions.buttons;
|
||||||
returnObject.buttons = new window.Store.TemplateButtonCollection();
|
returnObject.buttons = new window.Store.TemplateButtonCollection();
|
||||||
|
|
||||||
message.buttons.add(
|
returnObject.buttons.add(
|
||||||
message.hydratedButtons.map((button, index) => {
|
returnObject.hydratedButtons.map((button, index) => {
|
||||||
const i = `${null != button.index ? button.index : index}`;
|
const i = `${null != button.index ? button.index : index}`;
|
||||||
|
|
||||||
if (button.urlButton) {
|
if (button.urlButton) {
|
||||||
|
return new window.Store.TemplateButtonModel({
|
||||||
|
id: i,
|
||||||
|
displayText: button.urlButton?.displayText,
|
||||||
|
url: button.urlButton?.url,
|
||||||
|
subtype: 'url',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (button.callButton) {
|
||||||
|
return new window.Store.TemplateButtonModel({
|
||||||
|
id: i,
|
||||||
|
displayText: button.callButton.displayText,
|
||||||
|
phoneNumber: button.callButton.phoneNumber,
|
||||||
|
subtype: 'call',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return new window.Store.TemplateButtonModel({
|
return new window.Store.TemplateButtonModel({
|
||||||
id: i,
|
id: i,
|
||||||
displayText: button.urlButton?.displayText,
|
displayText: button.quickReplyButton?.displayText,
|
||||||
url: button.urlButton?.url,
|
selectionId: button.quickReplyButton?.id,
|
||||||
subtype: 'url',
|
subtype: 'quick_reply',
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (button.callButton) {
|
|
||||||
return new window.Store.TemplateButtonModel({
|
|
||||||
id: i,
|
|
||||||
displayText: button.callButton.displayText,
|
|
||||||
phoneNumber: button.callButton.phoneNumber,
|
|
||||||
subtype: 'call',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return new window.Store.TemplateButtonModel({
|
|
||||||
id: i,
|
|
||||||
displayText: button.quickReplyButton?.displayText,
|
|
||||||
selectionId: button.quickReplyButton?.id,
|
|
||||||
subtype: 'quick_reply',
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user