1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 05:15:54 +00:00
* Fixed: Infinite loop bug with the `<markdown />` Vue component.
* Fixed: Bug with the method that calculates the chat input height causing chat input to disappear completely.
* Changed: When an add-on fails to enable, a slightly better message will be logged to console.
This commit is contained in:
SirStendec 2021-11-19 17:12:17 -05:00
parent e704677e84
commit a35387abcf
5 changed files with 55 additions and 29 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.31.0", "version": "4.31.1",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -85,7 +85,10 @@ export default class AddonManager extends Module {
// main script's execution. // main script's execution.
for(const id of this.enabled_addons) for(const id of this.enabled_addons)
if ( this.hasAddon(id) && this.doesAddonTarget(id) ) if ( this.hasAddon(id) && this.doesAddonTarget(id) )
this._enableAddon(id); this._enableAddon(id).catch(err => {
this.log.error(`An error occured while enabling the add-on "${id}":` , err);
this.log.capture(err);
});
this.emit(':ready'); this.emit(':ready');
}); });
@ -353,7 +356,10 @@ export default class AddonManager extends Module {
// Actually load it. // Actually load it.
if ( this.doesAddonTarget(id) ) if ( this.doesAddonTarget(id) )
this._enableAddon(id); this._enableAddon(id).catch(err => {
this.log.error(`An error occured while enabling the add-on "${id}":` , err);
this.log.capture(err);
});
} }
async disableAddon(id, save = true) { async disableAddon(id, save = true) {

View file

@ -298,26 +298,31 @@ export default class Input extends Module {
const t = this; const t = this;
const originalOnKeyDown = inst.onKeyDown, const originalOnKeyDown = inst.onKeyDown,
originalOnMessageSend = inst.onMessageSend; originalOnMessageSend = inst.onMessageSend,
//old_resize = inst.resizeInput; old_resize = inst.resizeInput;
inst.resizeInput = function(msg) { inst.resizeInput = function(msg, ...args) {
if ( msg ) { try {
if ( inst.chatInputRef ) { if ( msg ) {
const style = getComputedStyle(inst.chatInputRef), if ( inst.chatInputRef instanceof Element ) {
height = style && parseFloat(style.lineHeight || 18) || 18, const style = getComputedStyle(inst.chatInputRef),
t = height * 1 + 20, height = style && parseFloat(style.lineHeight || 18) || 18,
i = Math.ceil((inst.chatInputRef.scrollHeight - t) / height), t = height * 1 + 20,
a = Math.min(1 + i, 4); i = Math.ceil((inst.chatInputRef.scrollHeight - t) / height),
a = Math.min(1 + i, 4);
inst.setState({
numInputRows: a
});
}
} else
inst.setState({ inst.setState({
numInputRows: a numInputRows: 1
}); });
} } catch (err) {
} else t.log.error('Error in resizeInput', err);
inst.setState({ return old_resize.call(this, msg, ...args);
numInputRows: 1 }
});
} }
inst.messageHistory = []; inst.messageHistory = [];

View file

@ -8,6 +8,9 @@
left: 0; left: 0;
} }
.chat-input__textarea .tw-textarea { .chat-input__textarea {
padding-left: 1rem !important; .chat-wysiwyg-input__editor,
.tw-textarea {
padding-left: 1rem !important;
}
} }

View file

@ -14,22 +14,34 @@ export default {
data() { data() {
return { return {
md: getMD() output: ''
} }
}, },
computed: { watch: {
output() { source() {
if ( ! this.md ) this.rebuild();
return '';
return this.md.render(this.source);
} }
}, },
created() { created() {
this.md = getMD();
if ( ! this.md ) if ( ! this.md )
awaitMD().then(md => this.md = md); awaitMD().then(md => {
this.md = md;
this.rebuild();
});
else
this.rebuild();
},
methods: {
rebuild() {
if ( ! this.md )
this.output = '';
else
this.output = this.md.render(this.source);
}
} }
} }