Skip to content

Commit

Permalink
helpers: replace Google Charts deprecated API with QuickChart
Browse files Browse the repository at this point in the history
  • Loading branch information
mendelskiv93 committed Jan 9, 2025
1 parent d1af614 commit 44f2a5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 12 additions & 6 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 44f2a5d

Please sign in to comment.