From 155c4b832281348c16be1f4ef667e6e23dbf1bd8 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 27 Aug 2021 18:13:24 +0530 Subject: chore: normalized all recipes to ensure compatibility with es6 (#639) - Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm. --- recipes/instagram/index.js | 7 ++----- recipes/instagram/package.json | 2 +- recipes/instagram/webview.js | 15 +++++++-------- 3 files changed, 10 insertions(+), 14 deletions(-) (limited to 'recipes/instagram') diff --git a/recipes/instagram/index.js b/recipes/instagram/index.js index 2c7de64..928d5b1 100644 --- a/recipes/instagram/index.js +++ b/recipes/instagram/index.js @@ -1,8 +1,5 @@ -module.exports = Franz => class Instagram extends Franz { +module.exports = Ferdi => class Instagram extends Ferdi { overrideUserAgent() { - return window.navigator.userAgent.replace( - /(Ferdi|Electron)\/\S+ \([^)]+\)/g, - '', - ); + return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); } }; diff --git a/recipes/instagram/package.json b/recipes/instagram/package.json index a3180d3..80391bc 100644 --- a/recipes/instagram/package.json +++ b/recipes/instagram/package.json @@ -1,7 +1,7 @@ { "id": "instagram", "name": "Instagram", - "version": "2.1.0", + "version": "2.2.0", "license": "MIT", "config": { "serviceURL": "https://instagram.com/direct/inbox", diff --git a/recipes/instagram/webview.js b/recipes/instagram/webview.js index be54317..b6d9aa3 100644 --- a/recipes/instagram/webview.js +++ b/recipes/instagram/webview.js @@ -1,15 +1,14 @@ -const path = require('path'); +const _path = _interopRequireDefault(require('path')); -module.exports = (Franz) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = (Ferdi) => { const getMessages = function getMessages() { const element = document.querySelector('a[href^="/direct/inbox"]'); - - if (element) { - Franz.setBadge(parseInt(element.innerText, 10)); - } + Ferdi.setBadge(element ? parseInt(element.innerText, 10) : 0); }; - Franz.loop(getMessages); + Ferdi.loop(getMessages); - Franz.injectCSS(path.join(__dirname, 'service.css')); + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); }; -- cgit v1.2.3-70-g09d2