fixed editor crash for non-object dragLimit and grid (#2344)
Some checks failed
CodeQL / Analyze (pull_request) Failing after 3m27s
Node.js CI / build (pull_request) Failing after 1m7s
Production Environment (checks if server starts) / Production Environment (pull_request) Failing after 27s
TestCafe Chrome (loads games, clicks buttons, checks the results) / Run TestCafe Tests (pull_request) Failing after 4s
TestCafe Firefox (loads games, clicks buttons, checks the results) / Run TestCafe Tests (pull_request) Failing after 5s

This commit is contained in:
ArnoldSmith86 2024-10-18 09:42:19 +02:00 committed by GitHub
parent e815729809
commit 89ee111789
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1402,7 +1402,7 @@ function jeAddGridCommand(key, value) {
id: 'grid_' + key,
name: key,
context: '^[^ ]* ↦ grid ↦ [0-9]+',
show: _=>!(key in jeStateNow.grid[+jeContext[2]]),
show: _=>typeof jeStateNow.grid[+jeContext[2]] == "object" && jeStateNow.grid[+jeContext[2]] !== null && !(key in jeStateNow.grid[+jeContext[2]]),
call: async function() {
jeStateNow.grid[+jeContext[2]][key] = '###SELECT ME###';
jeSetAndSelect(value);
@ -1410,26 +1410,13 @@ function jeAddGridCommand(key, value) {
});
}
function jeAddHexGridCommand(key, value) {
jeCommands.push({
id: 'hexGrid_' + key,
name: key,
context: '^[^ ]* ↦ grid ↦ [0-9]+',
show: _=>!(key in jeStateNow.hexGrid[+jeContext[2]]),
call: async function() {
jeStateNow.hexGrid[+jeContext[2]][key] = '###SELECT ME###';
jeSetAndSelect(value);
}
});
}
function jeAddLimitCommand(key, value) {
jeCommands.push({
id: 'limit_' + key,
name: key,
context: '^[^ ]* ↦ dragLimit',
show: _=>!(key in jeStateNow.dragLimit),
show: _=>typeof jeStateNow.dragLimit == "object" && jeStateNow.dragLimit !== null && !(key in jeStateNow.dragLimit),
call: async function() {
const w = widgets.get(jeStateNow.id);
jeStateNow.dragLimit[key] = '###SELECT ME###';