bandade fix for dictionary update freeze - what on earth happened here
This commit is contained in:
parent
1fef1cd8af
commit
4347510403
|
@ -345,16 +345,18 @@ class App extends Component<RouteComponentProps, State> {
|
|||
}
|
||||
|
||||
private handleDictionaryUpdate() {
|
||||
// TODO: fix - what the heck happened and what's going on here
|
||||
dictionary.update(() => {
|
||||
this.setState({ dictionaryStatus: "updating" });
|
||||
// this.setState({ dictionaryStatus: "updating" });
|
||||
}).then(({ dictionaryInfo }) => {
|
||||
if (this.state.dictionaryInfo?.release !== dictionaryInfo?.release) {
|
||||
console.log({ dictionaryInfo, old: this.state.dictionaryInfo })
|
||||
//if (this.state.dictionaryInfo?.release !== dictionaryInfo?.release) {
|
||||
// to avoid unnecessary re-rendering that breaks things
|
||||
this.setState({
|
||||
dictionaryStatus: "ready",
|
||||
dictionaryInfo,
|
||||
});
|
||||
}
|
||||
//}
|
||||
}).catch(() => {
|
||||
this.setState({ dictionaryStatus: "error loading" });
|
||||
});
|
||||
|
@ -439,7 +441,7 @@ class App extends Component<RouteComponentProps, State> {
|
|||
|
||||
// TODO: right now not checking user very often cause it messes with the state?
|
||||
// causes the verb quizzer to reset?
|
||||
private cronJob = new CronJob("* * * * *", () => {
|
||||
private cronJob = new CronJob("1/10 * * * *", () => {
|
||||
this.handleDictionaryUpdate();
|
||||
this.handleLoadUser();
|
||||
})
|
||||
|
|
|
@ -287,7 +287,6 @@ function pashtoFuzzyLookup<S extends T.DictionaryEntry>({ searchString, page, tp
|
|||
.find(slightlyFuzzyQuery)
|
||||
.limit(slightlyFuzzyResultsLimit)
|
||||
.data();
|
||||
console.log({ slightlyFuzzyResults });
|
||||
resultsGiven.push(...slightlyFuzzyResults.map((mpd: any) => mpd.$loki));
|
||||
// Get fuzzy matches
|
||||
const pashtoRegExLogic = fuzzifyPashto(search, {
|
||||
|
|
Loading…
Reference in New Issue