From c8a94e5a0accd87489bf5930c486a2e6900f49f5 Mon Sep 17 00:00:00 2001 From: Mahiru Date: Fri, 30 Aug 2024 19:51:08 +0800 Subject: [PATCH] fix: return {key} when did not get value from state --- packages/webgal/package.json | 2 +- packages/webgal/public/game/template/template.json | 2 +- packages/webgal/src/Core/gameScripts/setVar.ts | 4 ++-- packages/webgal/src/config/info.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webgal/package.json b/packages/webgal/package.json index 1d2f930a2..ed59ae5ac 100644 --- a/packages/webgal/package.json +++ b/packages/webgal/package.json @@ -1,7 +1,7 @@ { "name": "webgal", "private": true, - "version": "4.5.5", + "version": "4.5.6", "scripts": { "dev": "vite --host --port 3000", "build": "cross-env NODE_ENV=production tsc && vite build --base=./", diff --git a/packages/webgal/public/game/template/template.json b/packages/webgal/public/game/template/template.json index 742428439..8a398b19a 100644 --- a/packages/webgal/public/game/template/template.json +++ b/packages/webgal/public/game/template/template.json @@ -1,4 +1,4 @@ { "name":"Default Template", - "webgal-version":"4.5.5" + "webgal-version":"4.5.6" } diff --git a/packages/webgal/src/Core/gameScripts/setVar.ts b/packages/webgal/src/Core/gameScripts/setVar.ts index 3bc391ff5..a1f8d18f6 100644 --- a/packages/webgal/src/Core/gameScripts/setVar.ts +++ b/packages/webgal/src/Core/gameScripts/setVar.ts @@ -111,13 +111,13 @@ export function getValueFromState(key: string) { } /** - * 取不到时返回 key + * 取不到时返回 {key} */ export function getValueFromStateElseKey(key: string) { const valueFromState = getValueFromState(key); if (valueFromState === null || valueFromState === undefined) { logger.warn('valueFromState result null, key = ' + key); - return key; + return `{${key}}`; } return valueFromState; } diff --git a/packages/webgal/src/config/info.ts b/packages/webgal/src/config/info.ts index 0cac928f3..ec3046f15 100644 --- a/packages/webgal/src/config/info.ts +++ b/packages/webgal/src/config/info.ts @@ -1,5 +1,5 @@ export const __INFO = { - version: 'WebGAL 4.5.5', + version: 'WebGAL 4.5.6', contributors: [ // 现在改为跳转到 GitHub 了 ],