diff --git a/package.json b/package.json index 2f66ca07..0f7fad89 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.75.5", + "version": "4.75.6", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/addons.ts b/src/addons.ts index ecefcc95..b7ede06b 100644 --- a/src/addons.ts +++ b/src/addons.ts @@ -13,7 +13,7 @@ import type SettingsManager from './settings'; import type TranslationManager from './i18n'; import type LoadTracker from './load_tracker'; import type FrankerFaceZ from './main'; -import type { AddonInfo } from 'utilities/types'; +import type { AddonInfo, BasicAddonInfo } from 'utilities/types'; declare global { interface Window { @@ -245,7 +245,7 @@ export default class AddonManager extends Module<'addons'> { this.emit(':data-loaded'); } - addAddon(input: AddonInfo, is_dev: boolean = false) { + addAddon(input: BasicAddonInfo, is_dev: boolean = false) { let addon = input as FullAddonInfo; const old = this.addons[addon.id]; @@ -255,6 +255,8 @@ export default class AddonManager extends Module<'addons'> { addon.short_name_i18n = addon.short_name_i18n || `addon.${addon.id}.short_name`; addon.author_i18n = addon.author_i18n || `addon.${addon.id}.author`;*/ + addon.name = addon.name ?? addon.id; + addon.dev = is_dev; addon.requires = addon.requires || []; addon.required_by = Array.isArray(old) ? old : old && old.required_by || []; @@ -566,7 +568,7 @@ export default class AddonManager extends Module<'addons'> { crossorigin: 'anonymous' })); - // Error if this takes more than 5 seconds. + // Error if this takes more than 60 seconds. await timeout(this.waitFor(`addon.${id}:registered` as any), 60000); module = this.resolve(`addon.${id}`); diff --git a/src/modules/main_menu/components/addon-list.vue b/src/modules/main_menu/components/addon-list.vue index b0bd341b..47008e15 100644 --- a/src/modules/main_menu/components/addon-list.vue +++ b/src/modules/main_menu/components/addon-list.vue @@ -167,8 +167,8 @@ export default { if ( a.sort < b.sort ) return -1; if ( b.sort < a.sort ) return 1; - const a_n = a.name.toLowerCase(), - b_n = b.name.toLowerCase(); + const a_n = (a.name ?? a.id).toLowerCase(), + b_n = (b.name ?? b.id).toLowerCase(); if ( a_n < b_n ) return -1; if ( b_n < a_n ) return 1; diff --git a/src/modules/main_menu/components/addon.vue b/src/modules/main_menu/components/addon.vue index c4219aca..633355f8 100644 --- a/src/modules/main_menu/components/addon.vue +++ b/src/modules/main_menu/components/addon.vue @@ -31,13 +31,13 @@

{{ addon.name_i18n ? t(addon.name_i18n, addon.name) : addon.name }} ({{ addon.id }})

- + {{ t('addon.author', 'By: {author}', { author: addon.author_i18n ? t(addon.author_i18n, addon.author) : addon.author }) }} @@ -203,7 +203,10 @@ export default { if ( this.addon.description_i18n ) return this.t(this.addon.description_i18n, this.addon.description); - return this.addon.description; + else if ( this.addon.description ) + return this.addon.description; + + return this.t('addon.no-desc', '*No description.*'); }, maintainer() { @@ -322,4 +325,4 @@ export default { } } - \ No newline at end of file + diff --git a/src/sites/shared/player.jsx b/src/sites/shared/player.jsx index e2ef91da..bef61e65 100644 --- a/src/sites/shared/player.jsx +++ b/src/sites/shared/player.jsx @@ -8,7 +8,6 @@ import Module from 'utilities/module'; import {createElement, on, off} from 'utilities/dom'; import {isValidShortcut, debounce, has} from 'utilities/object'; -import { IS_FIREFOX } from 'utilities/constants'; import { getFontsList, useFont } from 'utilities/fonts'; const STYLE_VALIDATOR = createElement('span'); diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index 48440dc7..bff67a1c 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -219,7 +219,7 @@ export default class ChatHook extends Module { this.ChatRenderer = this.fine.define( 'chat-renderer', - n => n.mapMessageToChatLine && n.reportChatRenderSent, + n => n.mapMessagesToChatLines && n.reportChatRenderSent, Twilight.CHAT_ROUTES ); diff --git a/src/utilities/addon.ts b/src/utilities/addon.ts index 36228d1c..9450ef4d 100644 --- a/src/utilities/addon.ts +++ b/src/utilities/addon.ts @@ -3,6 +3,7 @@ import type { AddonInfo } from './types'; import type Logger from './logging'; import type TranslationManager from '../i18n'; import type SettingsManager from '../settings'; +import type AddonManager from '../addons'; /** * A special sub-class of {@link Module} used for the root module of an add-on. @@ -61,10 +62,18 @@ export class Addon & Partial; + // These types are used by get() export type ExtractSegments =