Skip to content

Commit

Permalink
tweak param
Browse files Browse the repository at this point in the history
  • Loading branch information
szdytom committed Jun 6, 2024
1 parent 4644bcd commit eebf153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useEffect, useState } from 'react';
import { parseSelectedUnits, loadWordList } from './data';

export function App() {
// const [page, setPage] = useState(() => {
// return parseSelectedUnits().length > 0 ? 'spell' : 'select';
// });

const [page, setPage] = useState(parseSelectedUnits().length > 0 ? 'spell' : 'select');
const [page, setPage] = useState(() => {
return parseSelectedUnits().length > 0 ? 'spell' : 'select';
});

const [wordlist, setWordlist] = useState(null);
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class RatingStore {
for (let word of wordlist) {
let item = await this.db.get('ratings', word);
if (item.learnt) {
let gap = Math.ceil(Math.pow(1.5, item.rating)) + 1;
let gap = Math.ceil(Math.pow(1.5, item.rating)) + item.rating + 1;
if (gap < step - item.lastApperance) {
review.push(item);
} else {
Expand Down

0 comments on commit eebf153

Please sign in to comment.