First Alpha
This commit is contained in:
@ -31,7 +31,8 @@ export default class EntryComponent extends Component<{ vault: Promise<IVault>,
|
||||
|
||||
private toVault() {
|
||||
// history.back()
|
||||
Navigation.setPage("/vault", { id: this.vault.id }, { entry: "false" }, true);
|
||||
history.back();
|
||||
// Navigation.setPage("/vault", { id: this.vault.id }, { entry: "false" }, true);
|
||||
}
|
||||
|
||||
async componentWillMount() {
|
||||
@ -128,7 +129,6 @@ export default class EntryComponent extends Component<{ vault: Promise<IVault>,
|
||||
if (this.state.changed) {
|
||||
let modal = new YesNoModal("Really want to quit?");
|
||||
let res = await modal.getResult();
|
||||
modal.close();
|
||||
if (res === true) {
|
||||
this.skip_save = true;
|
||||
this.toVault();
|
||||
@ -138,7 +138,6 @@ export default class EntryComponent extends Component<{ vault: Promise<IVault>,
|
||||
}
|
||||
|
||||
textAreaKeyPress(evt: KeyboardEvent) {
|
||||
console.log(evt);
|
||||
if ((evt.keyCode === 83 || evt.keyCode === 13) && evt.ctrlKey) {
|
||||
evt.preventDefault()
|
||||
this.save();
|
||||
|
@ -3,7 +3,6 @@ import Notes, { IVault, BaseNote } from "../../../notes";
|
||||
import AddButton from "../../AddButton";
|
||||
import Navigation from "../../../navigation";
|
||||
import ArrowLeft from "feather-icons/dist/icons/arrow-left.svg"
|
||||
import MoreVertival from "feather-icons/dist/icons/more-vertical.svg"
|
||||
import ContextMenu from "../../modals/context";
|
||||
import Notifications from "../../../notifications";
|
||||
|
||||
@ -17,7 +16,9 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
||||
}
|
||||
vault: IVault;
|
||||
|
||||
reloadNotes() {
|
||||
reloadNotes(s?: boolean) {
|
||||
if (s)
|
||||
return;
|
||||
return new Promise(yes => this.vault.getAllNotes().then(entries => this.setState({ notes: entries }, yes)));
|
||||
}
|
||||
|
||||
@ -169,7 +170,6 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
|
||||
<div class="card fluid">
|
||||
<h1 class="section double-padded">Notes: </h1>
|
||||
<div class="section">
|
||||
{elms}
|
||||
</div>
|
||||
|
@ -7,6 +7,7 @@ import EntryList from "./EntryList";
|
||||
|
||||
import "./vault.scss"
|
||||
|
||||
|
||||
export interface VaultProps {
|
||||
state: { id: string };
|
||||
hidden: { entry: string, id: string, note: string };
|
||||
@ -21,10 +22,19 @@ export default class VaultPage extends Page<VaultProps, { entries: BaseNote[] }>
|
||||
|
||||
async componentWillMount() {
|
||||
this.vault = Notes.getVault(this.props.state.id, Notes.getVaultKey(this.props.state.id))
|
||||
|
||||
this.vault.then(vlt => {
|
||||
window.debug.activeVault = vlt;
|
||||
window.debug.createNotes = (cnt = 10) => {
|
||||
for (let i = 0; i < cnt; i++) {
|
||||
let nt = vlt.newNote();
|
||||
nt.__value = `Random Note ${i}\ With some Content ${i}`;
|
||||
vlt.saveNote(nt);
|
||||
}
|
||||
}
|
||||
})
|
||||
this.vault.catch(err => {
|
||||
Navigation.setPage("/")
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Reference in New Issue
Block a user