From 44f2a5dc7fa05a2bbae680faf0360fe6c0722c96 Mon Sep 17 00:00:00 2001 From: Vedran Mendelski Date: Tue, 7 Jan 2025 17:32:25 +0100 Subject: [PATCH] helpers: replace Google Charts deprecated API with QuickChart --- package.json | 2 +- src/helpers.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7ce4059..64c3921 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-comment-manager", - "version": "0.5.2", + "version": "0.5.3", "description": "Minimal API for managing GitHub comments for CIclicks.", "repository": "https://github.com/status-im/github-comment-manager", "type": "module", diff --git a/src/helpers.js b/src/helpers.js index 2ecf15b..ffba9d5 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -49,14 +49,20 @@ const genQRCodeUrl = (data) => { if (!data.endsWith('apk') && !data.includes('i.diawi.com')) { return '' } - return new Handlebars.SafeString([ - '[:calling:]', - '(https://chart.apis.google.com/', - `chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=`, - encodeURIComponent(data), ')' - ].join('')) + + const baseUrl = 'https://quickchart.io/qr' + const queryParams = new URLSearchParams({ + text: data, + size: '400x400', + errorCorrectionLevel: 'L', + }) + + return new Handlebars.SafeString( + `[:calling:](https://quickchart.io/qr?${queryParams.toString()})` + ) } + export default { commitChanged, formatDate,