From dfae2d231e39c81827d08fd8834d736c5b3005b1 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Tue, 31 Aug 2021 16:25:57 +0530 Subject: refactor: Use Ferdi.safeParseInt to ensure that parsing is done consistently in all recipes. --- recipes/wechat/package.json | 2 +- recipes/wechat/webview.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'recipes/wechat') diff --git a/recipes/wechat/package.json b/recipes/wechat/package.json index ec29d19..b8af764 100644 --- a/recipes/wechat/package.json +++ b/recipes/wechat/package.json @@ -1,7 +1,7 @@ { "id": "wechat", "name": "WeChat", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "repository": "https://github.com/koma-private/recipe-wechat", "config": { diff --git a/recipes/wechat/webview.js b/recipes/wechat/webview.js index 874ab55..b1d8e31 100644 --- a/recipes/wechat/webview.js +++ b/recipes/wechat/webview.js @@ -13,8 +13,8 @@ module.exports = (Ferdi) => { const reddot = item.querySelector('i.web_wechat_reddot_middle'); const avatarImage = item.querySelector('img.img'); - if (reddot && reddot.innerText) { - count = parseInt(reddot.innerText); + if (reddot) { + count = Ferdi.safeParseInt(reddot.innerText); } if (avatarImage && avatarImage.getAttribute('src').search('webwxgeticon') != -1) { -- cgit v1.2.3-54-g00ecf