Tangled notifications browser extension

fix: tolerate whitespaces & newlines #2

merged opened by moshyfawn.dev targeting main from fix/count-response-formatting
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:sshwio5obbx4zjfrn3fhsen6/sh.tangled.repo.pull/3mep3m376to22
+2 -2
Diff #0
+1 -1
package.json
··· 2 2 "name": "tug", 3 3 "description": "A tug for every notification", 4 4 "private": true, 5 - "version": "0.1.1", 5 + "version": "0.1.2", 6 6 "type": "module", 7 7 "scripts": { 8 8 "dev": "wxt",
+1 -1
utils/api.ts
··· 12 12 // FIX: requires backend to return 401 when not logged in (currently returns 200 even if not logged in) 13 13 if (!response.ok) throw new Error(`HTTP ${response.status}`); 14 14 const html = await response.text(); 15 - const match = html.match(/>(\d+\+?)</); 15 + const match = html.match(/>\s*(\d+\+?)\s*</); 16 16 return match ? parseInt(match[1], 10) : 0; 17 17 };

History

1 round 0 comments
sign up or login to add to the discussion
moshyfawn.dev submitted #0
1 commit
expand
fix: tolerate whitespaces & newlines
expand 0 comments
pull request successfully merged