Skip to content

Commit

Permalink
fix: return {key} when did not get value from state
Browse files Browse the repository at this point in the history
  • Loading branch information
MakinoharaShoko committed Aug 30, 2024
1 parent 959185e commit c8a94e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/webgal/package.json
Original file line number Diff line number Diff line change
@@ -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=./",
Expand Down
2 changes: 1 addition & 1 deletion packages/webgal/public/game/template/template.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name":"Default Template",
"webgal-version":"4.5.5"
"webgal-version":"4.5.6"
}
4 changes: 2 additions & 2 deletions packages/webgal/src/Core/gameScripts/setVar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion packages/webgal/src/config/info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const __INFO = {
version: 'WebGAL 4.5.5',
version: 'WebGAL 4.5.6',
contributors: [
// 现在改为跳转到 GitHub 了
],
Expand Down

0 comments on commit c8a94e5

Please sign in to comment.