Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix window.Store.ProfilePic.profilePicFind is not a function error #3001

Merged

Conversation

seowzhenjun0126
Copy link

@seowzhenjun0126 seowzhenjun0126 commented May 2, 2024

PR Details

Replace window.Store.ProfilePic.profilePicFind with window.Store.ProfilePic.requestProfilePicFromServer

Description

The function

window.Store.ProfilePic.profilePicFind

is no longer available in v2.3x, and is replaced with

window.Store.ProfilePic.requestProfilePicFromServer

image

Related Issue

closes #3005

Motivation and Context

How Has This Been Tested

Types of changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).

@StiflerPasha
Copy link

and how about previous wa-versions?

@alechkos
Copy link
Collaborator

alechkos commented May 2, 2024

@StiflerPasha

and how about previous wa-versions?

In 2.2412.54, window.Store.ProfilePic.profilePicFind is defined

@StiflerPasha
Copy link

We need to make an implementation that is supported on both versions

Copy link
Collaborator

@alechkos alechkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seowzhenjun0126

Add support for previous WWeb versions,
you can use window.WWebJS.compareWwebVersions that is located in
src/util/Injected/Utils.js

Copy link

@guigo613 guigo613 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, it will break for older versions. I believe the best solution would be something like:

return await (window.Store.ProfilePic.profilePicFind || window.Store.ProfilePic.requestProfilePicFromServer)(chatWid);

taotao7 added a commit to taotao7/whatsapp-web.js that referenced this pull request May 7, 2024
@mauriciopfl
Copy link

In this case, it will break for older versions. I believe the best solution would be something like:

return await (window.Store.ProfilePic.profilePicFind || window.Store.ProfilePic.requestProfilePicFromServer)(chatWid);

Don`t work
Error on: window.WWebJS.compareWwebVersions

src/Client.js Outdated Show resolved Hide resolved
@alechkos alechkos merged commit 975819d into pedroslopez:webpack-exodus May 14, 2024
1 check passed
@Lyfhael
Copy link

Lyfhael commented May 15, 2024

Hey,
Should it be modified from this file too maybe ?

return await window.Store.ProfilePic.profilePicFind(chatWid);

@alechkos alechkos mentioned this pull request May 16, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get conact avatar.
7 participants