Code style changes.
This commit is contained in:
+11
-11
@@ -1,19 +1,19 @@
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { playSound, appQueueIsEmpty } from "./util.js";
|
||||
import { app } from '../../../scripts/app.js'
|
||||
import { playSound, appQueueIsEmpty } from './util.js'
|
||||
|
||||
app.registerExtension({
|
||||
name: "Notifications.PlaySound",
|
||||
name: 'Notifications.PlaySound',
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
if (nodeData.name === "Notif-PlaySound") {
|
||||
const onExecuted = nodeType.prototype.onExecuted;
|
||||
if (nodeData.name === 'Notif-PlaySound') {
|
||||
const onExecuted = nodeType.prototype.onExecuted
|
||||
nodeType.prototype.onExecuted = async function () {
|
||||
onExecuted?.apply(this, arguments);
|
||||
if (this.widgets[0].value === "on empty queue") {
|
||||
if (!await appQueueIsEmpty(app)) return;
|
||||
onExecuted?.apply(this, arguments)
|
||||
if (this.widgets[0].value === 'on empty queue') {
|
||||
if (!await appQueueIsEmpty(app)) return
|
||||
}
|
||||
let file = this.widgets[2].value;
|
||||
let file = this.widgets[2].value
|
||||
playSound(file, this.widgets[1].value)
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
+15
-15
@@ -1,29 +1,29 @@
|
||||
import { app } from "../../../scripts/app.js";
|
||||
import { app } from '../../../scripts/app.js'
|
||||
import {
|
||||
notificationSetup, sendNotification, getNotificationTextFromArguments,
|
||||
appQueueIsEmpty,
|
||||
} from "./util.js";
|
||||
} from './util.js'
|
||||
|
||||
app.registerExtension({
|
||||
name: "Notifications.SystemNotification",
|
||||
name: 'Notifications.SystemNotification',
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
if (nodeData.name === "Notif-SystemNotification") {
|
||||
const onExecuted = nodeType.prototype.onExecuted;
|
||||
if (nodeData.name === 'Notif-SystemNotification') {
|
||||
const onExecuted = nodeType.prototype.onExecuted
|
||||
nodeType.prototype.onExecuted = async function () {
|
||||
onExecuted?.apply(this, arguments);
|
||||
if (this.widgets[0].value === "on empty queue") {
|
||||
if (!await appQueueIsEmpty(app)) return;
|
||||
onExecuted?.apply(this, arguments)
|
||||
if (this.widgets[0].value === 'on empty queue') {
|
||||
if (!await appQueueIsEmpty(app)) return
|
||||
}
|
||||
if (!notificationSetup()) return;
|
||||
if (!notificationSetup()) return
|
||||
const notification_text = getNotificationTextFromArguments(arguments)
|
||||
sendNotification("ComfyUI", notification_text)
|
||||
};
|
||||
sendNotification('ComfyUI', notification_text)
|
||||
}
|
||||
|
||||
const onNodeCreated = nodeType.prototype.onNodeCreated;
|
||||
const onNodeCreated = nodeType.prototype.onNodeCreated
|
||||
nodeType.prototype.onNodeCreated = function () {
|
||||
onNodeCreated?.apply(this, arguments);
|
||||
notificationSetup();
|
||||
onNodeCreated?.apply(this, arguments)
|
||||
notificationSetup()
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user