Skip to content

Repairs the library so it actually loads

Choose a tag to compare

@awangga awangga released this 11 Sep 22:15
· 92 commits to main since this release

This release fixes bugs that made parts of the library unusable.

  • auth.js could not be parsed as an ES module at all: it imported setCookieWithExpireHour from cookie.js and also declared its own copy, which is a SyntaxError. Any page importing it failed to load.
  • config.js imported from whatsauth.js and helper.js, two files that do not exist in this repo, and DefaultSuccesser referenced undefined variables.
  • websocket.js's openWebSocketSetId always returned undefined because the socket was assigned inside a .then() callback and returned outside it, so sendMessagetoWebSocket/closeWebSocket could never receive a usable socket.
  • Removed duplicated code: IsMobile/isMobile existed twice, and the four JSON functions in api.js were four copies of the same request logic.

Breaking: openWebSocketSetId now returns a Promise that resolves with the WebSocket. It previously returned undefined in every case, so no working code can depend on the old behavior.