From 0cb7d52f2f6d7293ae010a5243a4e4cd9d504377 Mon Sep 17 00:00:00 2001 From: littlefean <2028140990@qq.com> Date: Sat, 23 Nov 2024 17:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/controller/ControllerGamepad.tsx | 2 +- src/core/stage/StageSaveManager.tsx | 8 ++++---- src/core/stageObject/entity/ImageNode.tsx | 4 ++-- src/pages/_toolbar.tsx | 4 ++-- src/pages/test.tsx | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/controller/ControllerGamepad.tsx b/src/core/controller/ControllerGamepad.tsx index a1e93836..c7097d50 100644 --- a/src/core/controller/ControllerGamepad.tsx +++ b/src/core/controller/ControllerGamepad.tsx @@ -97,7 +97,7 @@ export class ControllerGamepad implements Tickable, Disposable { this.initGamepad(gamepad); }; - private initGamepad(gamepad: Gamepad) {} + private initGamepad(_gamepad: Gamepad) {} on(event: K, listener: EventMap[K]) { if (!this.listeners[event]) { diff --git a/src/core/stage/StageSaveManager.tsx b/src/core/stage/StageSaveManager.tsx index 6ee85888..2269fe72 100644 --- a/src/core/stage/StageSaveManager.tsx +++ b/src/core/stage/StageSaveManager.tsx @@ -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(); @@ -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()); } @@ -85,7 +85,7 @@ export namespace StageSaveManager { path, content: string, }) - .then((res) => { + .then((_) => { successCallback(); isCurrentSaved = true; }) @@ -140,7 +140,7 @@ export namespace StageSaveManager { path, content, }) - .then((res) => { + .then((_) => { successCallback(); }) .catch((err) => { diff --git a/src/core/stageObject/entity/ImageNode.tsx b/src/core/stageObject/entity/ImageNode.tsx index 4706cd33..70841a79 100644 --- a/src/core/stageObject/entity/ImageNode.tsx +++ b/src/core/stageObject/entity/ImageNode.tsx @@ -128,9 +128,9 @@ export class ImageNode extends ConnectableEntity { this.state = "error"; }; }) - .catch((err) => { + .catch((_err) => { // 获取base64String失败 - + // TODO: 图片上显示ErrorDetails信息 this.state = "error"; }); } diff --git a/src/pages/_toolbar.tsx b/src/pages/_toolbar.tsx index 83002dbe..a6c1e32e 100644 --- a/src/pages/_toolbar.tsx +++ b/src/pages/_toolbar.tsx @@ -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) => { @@ -463,7 +463,7 @@ async function openBrowserOrFile() { function myOpen(url: string) { open(url) - .then((value) => {}) + .then((_) => {}) .catch((e) => { // 依然会导致程序崩溃,具体原因未知 console.error(e); diff --git a/src/pages/test.tsx b/src/pages/test.tsx index 981e63be..6f83f398 100644 --- a/src/pages/test.tsx +++ b/src/pages/test.tsx @@ -57,5 +57,5 @@ function handleTestImageBase64() { invoke("convert_image_to_base64", { imagePath: "D:\\Projects\\Project-Tools\\project-graph\\src\\assets\\icon.png", - }).then((res) => {}); + }).then((_res) => {}); }