aboutsummaryrefslogtreecommitdiff
path: root/.config/BetterDiscord/plugins/NotificationSounds.plugin.js
diff options
context:
space:
mode:
Diffstat (limited to '.config/BetterDiscord/plugins/NotificationSounds.plugin.js')
-rw-r--r--.config/BetterDiscord/plugins/NotificationSounds.plugin.js37
1 files changed, 21 insertions, 16 deletions
diff --git a/.config/BetterDiscord/plugins/NotificationSounds.plugin.js b/.config/BetterDiscord/plugins/NotificationSounds.plugin.js
index c90246f..0cdbc55 100644
--- a/.config/BetterDiscord/plugins/NotificationSounds.plugin.js
+++ b/.config/BetterDiscord/plugins/NotificationSounds.plugin.js
@@ -69,7 +69,7 @@ var NotificationSounds = (_ => {
return class NotificationSounds {
getName () {return "NotificationSounds";}
- getVersion () {return "3.4.6";}
+ getVersion () {return "3.4.7";}
getAuthor () {return "DevilBro";}
@@ -77,7 +77,7 @@ var NotificationSounds = (_ => {
constructor () {
this.changelog = {
- "improved":[["Song Deletion","You can now delete single songs, whole categories or all songs"]]
+ "improved":[["Incoming","Works again"]]
};
this.patchedModules = {
@@ -284,13 +284,11 @@ var NotificationSounds = (_ => {
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Implemented Sounds",
collapseStates: collapseStates,
- dividertop: true,
children: Object.keys(BDFDB.ObjectUtils.filter(types, typedata => typedata.implemented)).map(type => createSoundCard(type)).flat(10).filter(n => n)
}));
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Unimplemented Sounds",
collapseStates: collapseStates,
- dividertop: true,
children: Object.keys(BDFDB.ObjectUtils.filter(types, typedata => !typedata.implemented)).map(type => createSoundCard(type)).flat(10).filter(n => n)
}));
@@ -300,7 +298,6 @@ var NotificationSounds = (_ => {
settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, {
title: "Remove Songs",
collapseStates: collapseStates,
- dividertop: true,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
className: BDFDB.disCN.margintop4,
align: BDFDB.LibraryComponents.Flex.Align.END,
@@ -528,18 +525,24 @@ var NotificationSounds = (_ => {
this.forceUpdateAll();
}
}
-
+
processShakeable (e) {
- let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "IncomingCalls"});
- if (index > -1) {
- if (repatchIncoming) {
- children[index] = null;
- BDFDB.TimeUtils.timeout(_ => {
- repatchIncoming = false;
- BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"App", up:true}))
- });
+ if (e.returnvalue && BDFDB.ArrayUtils.is(e.returnvalue.props.children)) {
+ let child = e.returnvalue.props.children.find(n => {
+ let string = n && n.type && n.type.toString();
+ return string && string.indexOf("call_ringing_beat") > -1 && string.indexOf("call_ringing") > -1 && string.indexOf("hasIncomingCalls") > -1;
+ });
+ if (child) {
+ let index = e.returnvalue.props.children.indexOf(child);
+ if (repatchIncoming) {
+ e.returnvalue.props.children[index] = null;
+ BDFDB.TimeUtils.timeout(_ => {
+ repatchIncoming = false;
+ BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"App", up:true}))
+ });
+ }
+ else e.returnvalue.props.children[index] = BDFDB.ReactUtils.createElement(e.returnvalue.props.children[index].type, {});
}
- else children[index] = BDFDB.ReactUtils.createElement(children[index].type, {});
}
}
@@ -611,4 +614,6 @@ var NotificationSounds = (_ => {
BDFDB.TimeUtils.timeout(_ => {firedEvents[type] = false;},3000);
}
}
-})(); \ No newline at end of file
+})();
+
+module.exports = NotificationSounds; \ No newline at end of file