mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-29 11:34:13 +02:00
Fix debug plugin to simulate notifications more reliably
This commit is contained in:
parent
58296aa266
commit
4ea6f336f8
@ -18,30 +18,29 @@ enabled(){
|
|||||||
|
|
||||||
// ===================================
|
// ===================================
|
||||||
// N key - simulate popup notification
|
// N key - simulate popup notification
|
||||||
|
// S key - simulate sound notification
|
||||||
// ===================================
|
// ===================================
|
||||||
|
|
||||||
if (e.keyCode === 78){
|
if (e.keyCode === 78 || e.keyCode === 83){
|
||||||
var col = TD.controller.columnManager.getAllOrdered()[0];
|
var col = TD.controller.columnManager.getAllOrdered()[0];
|
||||||
|
|
||||||
|
var prevPopup = col.model.getHasNotification();
|
||||||
|
var prevSound = col.model.getHasSound();
|
||||||
|
|
||||||
|
col.model.setHasNotification(e.keyCode === 78);
|
||||||
|
col.model.setHasSound(e.keyCode === 83);
|
||||||
|
|
||||||
$.publish("/notifications/new",[{
|
$.publish("/notifications/new",[{
|
||||||
column: col,
|
column: col,
|
||||||
items: [
|
items: [
|
||||||
col.updateArray[Math.floor(Math.random()*col.updateArray.length)]
|
col.updateArray[Math.floor(Math.random()*col.updateArray.length)]
|
||||||
]
|
]
|
||||||
}]);
|
}]);
|
||||||
}
|
|
||||||
|
setTimeout(function(){
|
||||||
// ===================================
|
col.model.setHasNotification(prevPopup);
|
||||||
// S key - simulate sound notification
|
col.model.setHasSound(prevSound);
|
||||||
// ===================================
|
}, 1);
|
||||||
|
|
||||||
else if (e.keyCode === 83){
|
|
||||||
if ($TDX.hasCustomNotificationSound){
|
|
||||||
$TD.onTweetSound();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
document.getElementById("update-sound").play();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user