From e73534dd75c40dbd9ca4400470124e1520562ef5 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Thu, 6 Aug 2020 01:32:55 -0400 Subject: [PATCH] 4.20.25 * Changed: Better formatting for link embeds with no image. * Fixed: Date formatting issue in the emote menu. (What do you mean your sub didn't expire 51 years ago?) --- package.json | 2 +- .../modules/chat/emote_menu.jsx | 13 ++++--- src/utilities/rich_tokens.js | 35 ++++++++++++++++--- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 7e0fc796..9c8ee6fb 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.20.24", + "version": "4.20.25", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx index 05cff99c..5a26c7a4 100644 --- a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx +++ b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx @@ -655,31 +655,30 @@ export default class EmoteMenu extends Module { let calendar; - const renews = data.renews && data.renews - new Date, - ends = data.ends && data.ends - new Date; + const renews = data.renews && data.renews.getTime(), + ends = data.ends && data.ends.getTime(); if ( renews > 0 ) { calendar = { icon: 'calendar', - message: t.i18n.t('emote-menu.sub-renews', 'This sub renews in {seconds,humantime}.', {seconds: renews / 1000}) + message: t.i18n.t('emote-menu.sub-renews', 'This sub renews in {seconds,humantime}.', {seconds: renews}) } } else if ( ends ) { - const seconds = ends / 1000; if ( data.prime ) calendar = { icon: 'crown', - message: t.i18n.t('emote-menu.sub-prime', 'This is your free sub with Twitch Prime.\nIt ends in {seconds,humantime}.', {seconds}) + message: t.i18n.t('emote-menu.sub-prime', 'This is your free sub with Twitch Prime.\nIt ends in {seconds,humantime}.', {seconds: ends}) } else if ( data.gift ) calendar = { icon: 'gift', - message: t.i18n.t('emote-menu.sub-gift-ends', 'This gifted sub ends in {seconds,humantime}.', {seconds}) + message: t.i18n.t('emote-menu.sub-gift-ends', 'This gifted sub ends in {seconds,humantime}.', {seconds: ends}) } else calendar = { icon: 'calendar-empty', - message: t.i18n.t('emote-menu.sub-ends', 'This sub ends in {seconds,humantime}.', {seconds}) + message: t.i18n.t('emote-menu.sub-ends', 'This sub ends in {seconds,humantime}.', {seconds: ends}) } } diff --git a/src/utilities/rich_tokens.js b/src/utilities/rich_tokens.js index cba7c855..2707e797 100644 --- a/src/utilities/rich_tokens.js +++ b/src/utilities/rich_tokens.js @@ -531,8 +531,22 @@ function header_vue(token, h, ctx) { right ? null : content ]) } - } - } + + } else if ( ! token.compact ) + content = h('div', { + class: 'tw-flex ffz--rich-header' + }, [ + h('div', {class: 'ffz--header-image tw-mg-x-05'}), + content + ]); + + } else if ( ! token.compact ) + content = h('div', { + class: 'tw-flex ffz--rich-header' + }, [ + h('div', {class: 'ffz--header-image tw-mg-x-05'}), + content + ]); return content; } @@ -603,8 +617,21 @@ function header_normal(token, createElement, ctx) { className: 'tw-flex ffz--rich-header' }, [right ? content : null, image, right ? null : content]) } - } - } + } else if ( ! token.compact ) + content = createElement('div', { + className: 'tw-flex ffz--rich-header' + }, [ + createElement('div', {className: 'ffz--header-image tw-mg-x-05'}), + content + ]); + + } else if ( ! token.compact ) + content = createElement('div', { + className: 'tw-flex ffz--rich-header' + }, [ + createElement('div', {className: 'ffz--header-image tw-mg-x-05'}), + content + ]); return content;