From 51f04fc50b10442a5c4d84fa7cb04e433724adad Mon Sep 17 00:00:00 2001 From: _Lighty_ Date: Mon, 31 Aug 2020 13:49:27 +0200 Subject: [PATCH] URB v1.0.7 fix not working on canary --- Plugins/UnreadBadgesRedux/CHANGELOG.md | 3 +++ Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Plugins/UnreadBadgesRedux/CHANGELOG.md b/Plugins/UnreadBadgesRedux/CHANGELOG.md index 9c49d1f..00523b8 100644 --- a/Plugins/UnreadBadgesRedux/CHANGELOG.md +++ b/Plugins/UnreadBadgesRedux/CHANGELOG.md @@ -1,4 +1,7 @@ # [UnreadBadgesRedux](https://1lighty.github.io/BetterDiscordStuff/?plugin=UnreadBadgesRedux "UnreadBadgesRedux") Changelog +### 1.0.7 +- Fixed not working on canary. + ### 1.0.6 - Changed to module.exports because useless backwards incompatbile changes are the motto for BBD apparently. diff --git a/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js b/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js index defd1e3..a831b01 100644 --- a/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js +++ b/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js @@ -41,7 +41,7 @@ module.exports = (() => { twitter_username: '' } ], - version: '1.0.6', + version: '1.0.7', description: 'Adds a number badge to server icons and channels.', github: 'https://github.com/1Lighty', github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/UnreadBadgesRedux/UnreadBadgesRedux.plugin.js' @@ -50,7 +50,7 @@ module.exports = (() => { { title: 'fixed', type: 'fixed', - items: ['Changed to module.exports because useless backwards incompatbile changes are the motto for BBD apparently.'] + items: ['Fixed not working on canary.'] } ], defaultConfig: [ @@ -479,7 +479,8 @@ module.exports = (() => { Patcher.after(BlobMask.component.prototype, 'componentWillUnmount', _this => { if (typeof _this.props.__UBR_unread_count !== 'number') return; if (!_this.state.unreadBadgeMask) return; - _this.state.unreadBadgeMask.destroy(); + if (typeof _this.state.unreadBadgeMask.destroy === 'function') _this.state.unreadBadgeMask.destroy(); + else _this.state.unreadBadgeMask.dispose(); _this.state.unreadBadgeMask = null; }); Patcher.after(BlobMask.component.prototype, 'componentDidUpdate', (_this, [{ __UBR_unread_count }]) => { @@ -510,7 +511,7 @@ module.exports = (() => { const counter = _this.props.__UBR_unread_count || _this.state.__UBR_old_unread_count; if (_this.props.__UBR_unread_count) _this.state.__UBR_old_unread_count = _this.props.__UBR_unread_count; const width = BadgesModule.getBadgeWidthForValue(counter); - const unreadCountMaskSpring = _this.state.unreadBadgeMask.animated.spring; + const unreadCountMaskSpring = (_this.state.unreadBadgeMask.animated || _this.state.unreadBadgeMask.springs).spring; masks.props.children.push( React.createElement(ReactSpring.animated.rect, { x: -4,