Skip to content

Commit

Permalink
fix: Fixed compability with WhatsApp version 2.2144.11
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Nov 26, 2021
1 parent ac518d6 commit 25e8fd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/whatsapp/misc/Clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ exportModule(
ClockClass: (m) => m.Clock?.constructor || m.default?.constructor,
Clock: (m) => m.Clock || m.default,
},
(m) => m.Clock.globalUnixTime || m.default.globalUnixTime
(m) => m.Clock?.globalUnixTime || m.default?.globalUnixTime
);
5 changes: 3 additions & 2 deletions src/whatsapp/models/ProductMessageListModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export declare class ProductMessageListModel extends Model {
exportModule(
exports,
{
ProductMessageListModel: 'ProductMessageList',
ProductMessageListModel: (m) => m.ProductMessageList || m.default,
},
(m) => m.ProductMessageList
(m) =>
m.ProductMessageList || m.default?.prototype?.proxyName === 'product_list'
);
16 changes: 8 additions & 8 deletions src/whatsapp/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,34 @@ for (const name of storeNames) {
exportModule(
exports,
{
[name]: (m) => m[collectionName] || m[`${collectionName}Md`] || m.default,
[name]: (m) => m.default || m[collectionName],
},
(m) =>
(m[collectionName] || m[`${collectionName}Md`] || m.default) instanceof
(m.default || m[collectionName]) instanceof
(collections as any)[collectionName]
);
}

exportModule(
exports,
{
RecentStickerStore: (m) => m.RecentStickerCollectionMd,
RecentStickerStore: (m) => m.default || m.RecentStickerCollectionMd,
},
(m) => m.RecentStickerCollection && m.RecentStickerCollectionMd
(m) => m.RecentStickerCollection
);

exportModule(
exports,
{
StarredMsgStore: (m) => m.AllStarredMsgsCollection,
StarredMsgStore: (m) => m.default || m.AllStarredMsgsCollection,
},
(m) => m.StarredMsgCollection && m.AllStarredMsgsCollection
(m) => m.StarredMsgCollection
);

exportModule(
exports,
{
StickerPackStore: (m) => m.StickerPackCollectionMd,
StickerPackStore: (m) => m.default || m.StickerPackCollectionMd,
},
(m) => m.StickerPackCollection && m.StickerPackCollectionMd
(m) => m.StickerPackCollection
);

0 comments on commit 25e8fd1

Please sign in to comment.