URB v1.0.8

This commit is contained in:
_Lighty_ 2020-09-23 15:26:10 +02:00 committed by GitHub
parent a3dcde97b7
commit 34ab68e5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -41,7 +41,7 @@ module.exports = (() => {
twitter_username: '' twitter_username: ''
} }
], ],
version: '1.0.7', version: '1.0.8',
description: 'Adds a number badge to server icons and channels.', description: 'Adds a number badge to server icons and channels.',
github: 'https://github.com/1Lighty', github: 'https://github.com/1Lighty',
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js' github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js'
@ -50,7 +50,7 @@ module.exports = (() => {
{ {
title: 'fixed', title: 'fixed',
type: 'fixed', type: 'fixed',
items: ['Fixed not working on canary.'] items: ['Fixed not working on channels.']
} }
], ],
defaultConfig: [ defaultConfig: [
@ -350,10 +350,12 @@ module.exports = (() => {
so appending it without slicing first would append it to the components props so appending it without slicing first would append it to the components props
children array children array
*/ */
const buttons = ret.props.children.slice(0); const props = Utilities.findInReactTree(ret, e => Array.isArray(e.children) && e.children.find(e => e && e.type && e.type.displayName === 'ConnectedEditButton'));
if (!props) return;
const buttons = props.children.slice(0);
if (!buttons) return; if (!buttons) return;
buttons.splice(this.settings.misc.channelsDisplayOnLeft ? 0 : 2, 0, badge); buttons.splice(this.settings.misc.channelsDisplayOnLeft ? 0 : 2, 0, badge);
ret.props.children = buttons; props.children = buttons;
}); });
ChannelItem.forceUpdateAll(); ChannelItem.forceUpdateAll();
} }