fix: keep BatchDelete and TagMode enabled status

This commit is contained in:
skynono
2025-05-23 13:51:11 +08:00
parent 1644b7b15d
commit 2cc2d4f652

View File

@@ -888,9 +888,13 @@ const ChannelsTable = () => {
const localIdSort = localStorage.getItem('id-sort') === 'true';
const localPageSize =
parseInt(localStorage.getItem('page-size')) || ITEMS_PER_PAGE;
const localEnableTagMode = localStorage.getItem('enable-tag-mode') === 'true';
const localEnableBatchDelete = localStorage.getItem('enable-batch-delete') === 'true';
setIdSort(localIdSort);
setPageSize(localPageSize);
loadChannels(0, localPageSize, localIdSort, enableTagMode)
setEnableTagMode(localEnableTagMode);
setEnableBatchDelete(localEnableBatchDelete);
loadChannels(0, localPageSize, localIdSort, localEnableTagMode)
.then()
.catch((reason) => {
showError(reason);
@@ -1486,10 +1490,12 @@ const ChannelsTable = () => {
{t('开启批量操作')}
</Typography.Text>
<Switch
checked={enableBatchDelete}
label={t('开启批量操作')}
uncheckedText={t('关')}
aria-label={t('是否开启批量操作')}
onChange={(v) => {
localStorage.setItem('enable-batch-delete', v + '');
setEnableBatchDelete(v);
}}
/>
@@ -1553,6 +1559,7 @@ const ChannelsTable = () => {
uncheckedText={t('关')}
aria-label={t('是否启用标签聚合')}
onChange={(v) => {
localStorage.setItem('enable-tag-mode', v + '');
setEnableTagMode(v);
loadChannels(0, pageSize, idSort, v);
}}