Repository navigation
Repairs the library so it actually loads
This release fixes bugs that made parts of the library unusable.
auth.jscould not be parsed as an ES module at all: it importedsetCookieWithExpireHourfromcookie.jsand also declared its own copy, which is aSyntaxError. Any page importing it failed to load.config.jsimported fromwhatsauth.jsandhelper.js, two files that do not exist in this repo, andDefaultSuccesserreferenced undefined variables.websocket.js'sopenWebSocketSetIdalways returnedundefinedbecause the socket was assigned inside a.then()callback and returned outside it, sosendMessagetoWebSocket/closeWebSocketcould never receive a usable socket.- Removed duplicated code:
IsMobile/isMobileexisted twice, and the four JSON functions inapi.jswere 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.