Skip to content

Commit 599926c

Browse files
committed
🐛 Ensure toggle status is reflected for replenishment workbooks (#1749)
1 parent a3fbe61 commit 599926c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib/components/WorkBooks/WorkBookList.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
}),
5959
);
6060
61+
let isShowReplenishment: boolean = $state(replenishmentWorkBooksStore.canView());
62+
6163
function countReadableWorkbooks(workbooks: WorkbooksList): number {
6264
const results = workbooks.reduce((count, workbook: WorkbookList) => {
6365
const hasReadPermission = canRead(workbook.isPublished, userId, workbook.authorId);
@@ -158,16 +160,16 @@
158160

159161
<div class="mt-4 md:mt-0 pb-4">
160162
<Toggle
161-
checked={replenishmentWorkBooksStore.canView()}
162-
onclick={replenishmentWorkBooksStore.toggleView}
163+
checked={isShowReplenishment}
164+
onclick={() => replenishmentWorkBooksStore.toggleView()}
163165
aria-label="Toggle visibility of replenishment workbooks for curriculum"
164166
>
165167
問題集を表示
166168
</Toggle>
167169
</div>
168170
</div>
169171

170-
{#if replenishmentWorkBooksStore.canView()}
172+
{#if isShowReplenishment}
171173
<WorkBookBaseTable
172174
{workbookType}
173175
workbooks={replenishedWorkbooks}

0 commit comments

Comments
 (0)