Disable A button on blank slots

Pressing A on a slot for a file that doesn't have a log does nothing
This commit is contained in:
RedstonewolfX 2024-07-18 18:55:37 -04:00
parent 898a153104
commit a5335e1cc8

View File

@ -110,13 +110,15 @@ export default class LogSelectUiHandler extends MessageUiHandler {
const originalCallback = this.selectCallback; const originalCallback = this.selectCallback;
const cursor = this.cursor + this.scrollCursor; const cursor = this.cursor + this.scrollCursor;
var k = this.sessionSlots[cursor].key var k = this.sessionSlots[cursor].key
var file = JSON.parse(localStorage.getItem(k)) as LoggerTools.DRPD; if (k != undefined) {
console.log(k, file) var file = JSON.parse(localStorage.getItem(k)) as LoggerTools.DRPD;
LoggerTools.generateEditHandlerForLog(this.scene, this.sessionSlots[cursor].logIndex, () => { console.log(k, file)
this.selectCallback = null; LoggerTools.generateEditHandlerForLog(this.scene, this.sessionSlots[cursor].logIndex, () => {
originalCallback(k) this.selectCallback = null;
})() originalCallback(k)
success = true; })()
success = true;
}
} else if (button === Button.CANCEL) { } else if (button === Button.CANCEL) {
this.quitCallback(undefined); this.quitCallback(undefined);
} else { } else {