Linting and eliminated mobx warning.

This commit is contained in:
Daan Vanden Bosch 2019-07-21 10:44:33 +02:00
parent 14dd8dabff
commit 99d401e785
3 changed files with 5 additions and 6 deletions

View File

@ -7,10 +7,9 @@ import { ArrayBufferCursor } from "../../cursor/ArrayBufferCursor";
import { Cursor } from "../../cursor/Cursor";
import { ResizableBufferCursor } from "../../cursor/ResizableBufferCursor";
import { Vec3 } from "../../vector";
import { Instruction, parse_bin, write_bin, OP_RET, BB_MAP_DESIGNATE, SET_EPISODE } from "./bin";
import { BB_MAP_DESIGNATE, Instruction, OP_RET, parse_bin, SET_EPISODE, write_bin } from "./bin";
import { DatFile, DatNpc, DatObject, parse_dat, write_dat } from "./dat";
import { parse_qst, QstContainedFile, write_qst } from "./qst";
import { number } from "prop-types";
const logger = Logger.get("data_formats/parsing/quest");

View File

@ -1,5 +1,5 @@
import { computed, observable, action } from "mobx";
import { DatNpc, DatObject, DatUnknown } from "../data_formats/parsing/quest/dat";
import { action, computed, observable } from "mobx";
import { DatUnknown } from "../data_formats/parsing/quest/dat";
import { Vec3 } from "../data_formats/vector";
import { enum_values } from "../enums";
import { ItemType } from "./items";

View File

@ -29,14 +29,14 @@ export class UndoStack {
* The first action that will be undone when calling undo().
*/
@computed get first_undo(): Action | undefined {
return this.stack[this.index - 1];
return this.can_undo ? this.stack[this.index - 1] : undefined;
}
/**
* The first action that will be redone when calling redo().
*/
@computed get first_redo(): Action | undefined {
return this.stack[this.index];
return this.can_redo ? this.stack[this.index] : undefined;
}
@action