From 97697e3d069972844b2912a93022f4a4904a40d6 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 31 Jul 2021 15:28:23 +0530 Subject: Fixed eslintrc as root for this folder; Reformatted all files. --- recipes/pleroma/webview.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'recipes/pleroma') diff --git a/recipes/pleroma/webview.js b/recipes/pleroma/webview.js index d9fc9b1..07f2dc0 100644 --- a/recipes/pleroma/webview.js +++ b/recipes/pleroma/webview.js @@ -4,10 +4,10 @@ const titleRegex = /^\((\d+)\)/; const getJson = async (relativeUri) => { const req = await window.fetch(`${window.origin}${relativeUri}`, { - 'Accept': 'application/json' + Accept: 'application/json', }); return req.json(); -} +}; const getInstanceConfig = async () => { const origin = window.origin; @@ -59,7 +59,7 @@ const unscalePixel = b => b / SCALE; const blend = (bgValue, bgWeight, fgValue, fgWeight) => { const sum = bgValue * bgWeight + fgValue * fgWeight; return clamp(sum / (bgWeight + fgWeight)); -} +}; class LogoUpdater { constructor(img, mask) { @@ -87,12 +87,10 @@ class LogoUpdater { this._previousFg = fg; return true; } - } else { - if (this._previousBg !== bg) { - this._updateNoMask(bg); - this._previousBg = bg; - return true; - } + } else if (this._previousBg !== bg) { + this._updateNoMask(bg); + this._previousBg = bg; + return true; } return false; } @@ -133,7 +131,7 @@ class LogoUpdater { this._ctx.fillStyle = str; this._ctx.fillRect(0, 0, 1, 1); return this._ctx.getImageData(0, 0, 1, 1).data; - }; + } _drawImage() { this._ctx.drawImage(this._img, this._dx, this._dy); @@ -141,7 +139,6 @@ class LogoUpdater { } module.exports = Ferdi => { - const getMessages = () => { let directCount = 0; const matchArr = document.title.match(titleRegex); @@ -162,5 +159,5 @@ module.exports = Ferdi => { }, (e) => { console.log('Failed to load instance logo', e); Ferdi.loop(getMessages); - }) + }); }; -- cgit v1.2.3-70-g09d2