diff --git a/src/components/routes/vault/Entry.tsx b/src/components/routes/vault/Entry.tsx index 96cdd9d..375dc13 100755 --- a/src/components/routes/vault/Entry.tsx +++ b/src/components/routes/vault/Entry.tsx @@ -12,17 +12,14 @@ import Modal from "../../modals/Modal"; const minRows = 3; export default class EntryComponent extends Component<{ vault: Promise, id: string | undefined, note: string | undefined }, { title: string, changed: boolean }> { - old_text: string; - text: string = ""; - vault: IVault; - lineHeight: number = 24; - note: ViewNote; + private text: string = ""; + private vault: IVault; + // private lineHeight: number = 24; + private note: ViewNote; - rows: number = minRows; + private rows: number = minRows; - skip_save: boolean = false; - - // loading?: LoadingModal; + private skip_save: boolean = false; constructor(props) { super(props); @@ -30,12 +27,16 @@ export default class EntryComponent extends Component<{ vault: Promise, } private toVault() { - // history.back() history.back(); - // Navigation.setPage("/vault", { id: this.vault.id }, { entry: "false" }, true); } async componentWillMount() { + this.text = ""; + this.vault = undefined; + this.note = undefined; + this.rows = minRows; + this.skip_save = false; + this.setState({ changed: false, title: "" }); try { this.skip_save = false; // this.loading = new LoadingModal(); @@ -64,6 +65,10 @@ export default class EntryComponent extends Component<{ vault: Promise, if (rows !== this.rows) { this.rows = rows; } + // async onKeypress(event) { + // event = event || window.event; + // + // } let [title] = this.text.split("\n", 1); this.setState({ title, changed }) // if (this.loading) @@ -86,11 +91,6 @@ export default class EntryComponent extends Component<{ vault: Promise, } } - // async onKeypress(event) { - // event = event || window.event; - // - // } - componentWillUnmount() { if (!this.skip_save) this.save() @@ -161,6 +161,10 @@ export default class EntryComponent extends Component<{ vault: Promise, const delete_handler = async () => { await this.vault.deleteNote(this.props.id); this.toVault() + // async onKeypress(event) { + // event = event || window.event; + // + // } } return
@@ -174,13 +178,18 @@ export default class EntryComponent extends Component<{ vault: Promise,