Skip to content

Commit

Permalink
fix: Disabled link preview for beta/multidevice (fix #707)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Dec 9, 2021
1 parent 696e31b commit 0d9e2ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/wapi/functions/send-link-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export async function sendLinkPreview(chatId, url, text) {
}
var chat = await WAPI.sendExist(chatId);
if (!chat.erro) {
const linkPreview = await Store.WapQuery.queryLinkPreview(url);
// There are no support for link preview with MD
const linkPreview = WPP.auth.isMultiDevice()
? undefined
: await Store.WapQuery.queryLinkPreview(url);
var result =
(await chat.sendMessage(text.includes(url) ? text : `${url}\n${text}`, {
linkPreview,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/sendMessageOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export async function sendMessageOptions(chatId, content, options = {}) {
if (options.linkPreview) {
delete options.linkPreview;
const link = await window.Store.Validators.findLink(content);
if (link) {
if (link && !WPP.auth.isMultiDevice()) {
const preview = await window.Store.Wap2.default.queryLinkPreview(
link.url
);
Expand Down

0 comments on commit 0d9e2ee

Please sign in to comment.