From cccdef270634a10807ac653a677dfc5f71ad5000 Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Tue, 7 Apr 2020 10:36:22 -0700 Subject: [PATCH] Extra tasks support --- build/page.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/build/page.js b/build/page.js index 8d1e819..abd30e0 100644 --- a/build/page.js +++ b/build/page.js @@ -119,16 +119,20 @@ module.exports = exports = class Page extends File { res[camelCased] = true; return res; }, {}); - } tasks () { - if (!isObject(this.tweets)) return []; - - return Object.values(this.tweets) - .map((t) => t.media) - .flat() - .map((m) => ({ ...m, action: actions.fetch, output: m.output })); + const tasks = []; + if (isObject(this.tweets)) { + tasks.push(...( + Object.values(this.tweets) + .map((t) => t.media) + .flat() + .map((m) => ({ ...m, action: actions.fetch, output: m.output })) + )); + } + if (this._tasks) tasks.push(...this._tasks); + return tasks; } };