mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Add the ability to hide the forgetting curve from card info
This commit is contained in:
parent
bcb28f0a85
commit
c70e9d26c5
2 changed files with 5 additions and 3 deletions
|
@ -15,6 +15,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
export let stats: CardStatsResponse | null = null;
|
||||
export let showRevlog: boolean = true;
|
||||
export let showCurve: boolean = true;
|
||||
|
||||
$: fsrsEnabled = stats?.memoryState != null;
|
||||
$: desiredRetention = stats?.desiredRetention ?? 0.9;
|
||||
|
@ -41,7 +42,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<Revlog revlog={stats.revlog} {fsrsEnabled} />
|
||||
</Row>
|
||||
{/if}
|
||||
{#if fsrsEnabled}
|
||||
{#if fsrsEnabled && showCurve}
|
||||
<Row>
|
||||
<ForgettingCurve revlog={stats.revlog} {desiredRetention} {decay} />
|
||||
</Row>
|
||||
|
|
|
@ -12,6 +12,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
export let data: PageData;
|
||||
|
||||
const showRevlog = $page.url.searchParams.get("revlog") !== "0";
|
||||
const showCurve = $page.url.searchParams.get("curve") !== "0";
|
||||
|
||||
globalThis.anki ||= {};
|
||||
globalThis.anki.updateCardInfos = async (card_id: string): Promise<void> => {
|
||||
|
@ -25,11 +26,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<center>
|
||||
{#if data.currentInfo}
|
||||
<h3>Current</h3>
|
||||
<CardInfo stats={data.currentInfo} {showRevlog} />
|
||||
<CardInfo stats={data.currentInfo} {showRevlog} {showCurve} />
|
||||
{/if}
|
||||
{#if data.previousInfo}
|
||||
<h3>Previous</h3>
|
||||
<CardInfo stats={data.previousInfo} {showRevlog} />
|
||||
<CardInfo stats={data.previousInfo} {showRevlog} {showCurve} />
|
||||
{/if}
|
||||
</center>
|
||||
|
||||
|
|
Loading…
Reference in a new issue