1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 12:55:55 +00:00
* Fixed: Certain chat features not working correctly during a Shared Chat session. (Closes #1574)
* Fixed: The Add-Ons menu not displaying a loaded add-on if it has incomplete data.
This commit is contained in:
SirStendec 2024-10-31 14:19:36 -04:00
parent ef7e91f82b
commit a5ba29a153
8 changed files with 31 additions and 16 deletions

View file

@ -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",

View file

@ -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}`);

View file

@ -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;

View file

@ -31,13 +31,13 @@
<h4>
{{ addon.name_i18n ? t(addon.name_i18n, addon.name) : addon.name }}
<span
v-if="addon.dev || addon.unlisted"
v-if="addon.dev || addon.unlisted "
class="tw-c-text-alt-2 tw-font-size-6"
>
({{ addon.id }})
</span>
</h4>
<span class="tw-c-text-alt tw-mg-r-1">
<span v-if="addon.author" class="tw-c-text-alt tw-mg-r-1">
{{ 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 {
}
}
</script>
</script>

View file

@ -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');

View file

@ -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
);

View file

@ -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<TPath extends string = '', TEventMap extends ModuleEvents = M
if ( ! info && this.info )
info = this.info;
const ffz = window.FrankerFaceZ.get();
if ( info ) {
info.id = id;
(ffz as any).addons.addAddon(info);
const ffz = window.FrankerFaceZ.get(),
addons = (ffz as any)?.addons as AddonManager;
if ( addons ) {
if ( info ) {
info.id = id;
addons.addAddon(info);
} else if ( ! addons.hasAddon(id) )
addons.addAddon({
id
});
}
try {

View file

@ -93,6 +93,8 @@ export type AddonInfo = {
};
export type BasicAddonInfo = Pick<AddonInfo, 'id'> & Partial<AddonInfo>;
// These types are used by get()
export type ExtractSegments<Input extends string> =