URB v1.0.7 fix not working on canary

This commit is contained in:
_Lighty_ 2020-08-31 13:49:27 +02:00
parent 2d7640f038
commit 51f04fc50b
2 changed files with 8 additions and 4 deletions

View File

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

View File

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