Skip to content

Commit 3fca50b

Browse files
authored
Migrate (#42)
1 parent 9e75892 commit 3fca50b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/extensions/core/undoRedo.js renamed to src/extensions/core/undoRedo.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function checkState() {
2121
}
2222

2323
const loadGraphData = app.loadGraphData;
24-
app.loadGraphData = async function () {
25-
const v = await loadGraphData.apply(this, arguments);
24+
app.loadGraphData = async function (...args) {
25+
const v = await loadGraphData.apply(this, args);
2626
if (isOurLoad) {
2727
isOurLoad = false;
2828
} else {
@@ -122,7 +122,7 @@ window.addEventListener(
122122
return;
123123
}
124124
}
125-
125+
126126
keyIgnored = e.key === "Control" || e.key === "Shift" || e.key === "Alt" || e.key === "Meta";
127127
if (keyIgnored) return;
128128

@@ -155,13 +155,17 @@ api.addEventListener("promptQueued", () => {
155155
});
156156

157157
// Handle litegraph clicks
158+
// @ts-ignore
158159
const processMouseUp = LGraphCanvas.prototype.processMouseUp;
160+
// @ts-ignore
159161
LGraphCanvas.prototype.processMouseUp = function (e) {
160162
const v = processMouseUp.apply(this, arguments);
161163
checkState();
162164
return v;
163165
};
166+
// @ts-ignore
164167
const processMouseDown = LGraphCanvas.prototype.processMouseDown;
168+
// @ts-ignore
165169
LGraphCanvas.prototype.processMouseDown = function (e) {
166170
const v = processMouseDown.apply(this, arguments);
167171
checkState();

0 commit comments

Comments
 (0)