Skip to content

Commit

Permalink
🐛 修复未使用的变量
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlefean committed Nov 23, 2024
1 parent cf75f19 commit 0cb7d52
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/controller/ControllerGamepad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ControllerGamepad implements Tickable, Disposable {
this.initGamepad(gamepad);
};

private initGamepad(gamepad: Gamepad) {}
private initGamepad(_gamepad: Gamepad) {}

on<K extends keyof EventMap>(event: K, listener: EventMap[K]) {
if (!this.listeners[event]) {
Expand Down
8 changes: 4 additions & 4 deletions src/core/stage/StageSaveManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export namespace StageSaveManager {
path,
content: JSON.stringify(data, null, 2),
})
.then((res) => {
.then((_) => {
Stage.effects.push(ViewFlashEffect.SaveFile());
StageHistoryManager.reset(data); // 重置历史
successCallback();
Expand Down Expand Up @@ -60,7 +60,7 @@ export namespace StageSaveManager {
path: Stage.Path.getFilePath(),
content: JSON.stringify(data, null, 2),
})
.then((res) => {
.then((_) => {
if (addFlashEffect) {
Stage.effects.push(ViewFlashEffect.SaveFile());
}
Expand All @@ -85,7 +85,7 @@ export namespace StageSaveManager {
path,
content: string,
})
.then((res) => {
.then((_) => {
successCallback();
isCurrentSaved = true;
})
Expand Down Expand Up @@ -140,7 +140,7 @@ export namespace StageSaveManager {
path,
content,
})
.then((res) => {
.then((_) => {
successCallback();
})
.catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions src/core/stageObject/entity/ImageNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ export class ImageNode extends ConnectableEntity {
this.state = "error";
};
})
.catch((err) => {
.catch((_err) => {
// 获取base64String失败

// TODO: 图片上显示ErrorDetails信息
this.state = "error";
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const onSaveSelectedNew = async () => {
path,
content: JSON.stringify(data, null, 2),
})
.then((res) => {
.then((_) => {
Stage.effects.push(new ViewFlashEffect(Color.Black));
})
.catch((err) => {
Expand Down Expand Up @@ -463,7 +463,7 @@ async function openBrowserOrFile() {

function myOpen(url: string) {
open(url)
.then((value) => {})
.then((_) => {})
.catch((e) => {
// 依然会导致程序崩溃,具体原因未知
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ function handleTestImageBase64() {
invoke<string>("convert_image_to_base64", {
imagePath:
"D:\\Projects\\Project-Tools\\project-graph\\src\\assets\\icon.png",
}).then((res) => {});
}).then((_res) => {});
}

0 comments on commit 0cb7d52

Please sign in to comment.