oops, problem with importing mock instead of real function
This commit is contained in:
parent
c155c2c4ca
commit
2d93a856a5
|
@ -79,7 +79,9 @@ import {
|
||||||
} from "./types/dictionary-types";
|
} from "./types/dictionary-types";
|
||||||
import PhraseBuilder from "./screens/PhraseBuilder";
|
import PhraseBuilder from "./screens/PhraseBuilder";
|
||||||
import { searchAllInflections } from "./lib/search-all-inflections";
|
import { searchAllInflections } from "./lib/search-all-inflections";
|
||||||
import { addToWordlist } from "./lib/__mocks__/wordlist-database";
|
import {
|
||||||
|
addToWordlist,
|
||||||
|
} from "./lib/wordlist-database";
|
||||||
|
|
||||||
// to allow Moustrap key combos even when input fields are in focus
|
// to allow Moustrap key combos even when input fields are in focus
|
||||||
Mousetrap.prototype.stopCallback = function () {
|
Mousetrap.prototype.stopCallback = function () {
|
||||||
|
@ -246,7 +248,6 @@ class App extends Component<RouteComponentProps, State> {
|
||||||
this.handlePowerSearch();
|
this.handlePowerSearch();
|
||||||
});
|
});
|
||||||
Mousetrap.bind(["ctrl+s", "command+s"], (e) => {
|
Mousetrap.bind(["ctrl+s", "command+s"], (e) => {
|
||||||
console.log("hit ctrl+s");
|
|
||||||
if (this.state.user?.level === "basic") return;
|
if (this.state.user?.level === "basic") return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!this.state.isolatedEntry) return;
|
if (!this.state.isolatedEntry) return;
|
||||||
|
@ -254,7 +255,6 @@ class App extends Component<RouteComponentProps, State> {
|
||||||
entry: this.state.isolatedEntry,
|
entry: this.state.isolatedEntry,
|
||||||
notes: "",
|
notes: "",
|
||||||
};
|
};
|
||||||
console.log("Adding this to wordlist", toAdd);
|
|
||||||
addToWordlist(toAdd);
|
addToWordlist(toAdd);
|
||||||
});
|
});
|
||||||
Mousetrap.bind(["ctrl+\\", "command+\\"], (e) => {
|
Mousetrap.bind(["ctrl+\\", "command+\\"], (e) => {
|
||||||
|
|
|
@ -45,9 +45,7 @@ export async function addToWordlist({ entry, notes }: {
|
||||||
entry,
|
entry,
|
||||||
notes,
|
notes,
|
||||||
};
|
};
|
||||||
console.log("going to add to wordlist", entry);
|
|
||||||
await addToLocalDb({ type: "wordlist", doc });
|
await addToLocalDb({ type: "wordlist", doc });
|
||||||
console.log("has been added");
|
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue