Small fixes

This commit is contained in:
Natsumi
2025-12-25 08:35:58 +13:00
parent 44b0c8bfde
commit 6977cfd9a4
5 changed files with 41 additions and 24 deletions

View File

@@ -40,9 +40,19 @@ export function useDateNavigation(allDateOfActivity, reloadData) {
const idx = allDateOfActivityArray.value.findIndex((date) =>
date.isSame(selectedDate.value, 'day')
);
// when invalid date is selected, find the next closest date
if (idx === -1 && !isNext) {
const newIdx = allDateOfActivityArray.value.findIndex((date) =>
date.isBefore(selectedDate.value, 'day')
);
selectedDate.value = allDateOfActivityArray.value[newIdx].toDate();
reloadData();
return;
}
if (idx !== -1) {
const newIdx = isNext ? idx - 1 : idx + 1;
if (newIdx >= 0 && newIdx < allDateOfActivityArray.value.length) {
selectedDate.value =
allDateOfActivityArray.value[newIdx].toDate();
@@ -50,6 +60,8 @@ export function useDateNavigation(allDateOfActivity, reloadData) {
return;
}
}
// Fallback to the first/last date
selectedDate.value = isNext
? allDateOfActivityArray.value[0].toDate()
: allDateOfActivityArray.value[

View File

@@ -9,7 +9,7 @@
<div style="margin-top: 10px">
<div style="display: flex; align-items: center; justify-content: space-between; font-size: 12px">
<span class="name" style="margin-right: 24px">{{ t('dialog.registry_backup.auto_backup') }}</span>
<el-switch v-model="vrcRegistryAutoBackup" @change="setVrcRegistryAutoBackup"></el-switch>
<el-switch :model-value="vrcRegistryAutoBackup" @change="setVrcRegistryAutoBackup"></el-switch>
</div>
<div
style="
@@ -20,7 +20,7 @@
margin-top: 5px;
">
<span class="name" style="margin-right: 24px">{{ t('dialog.registry_backup.ask_to_restore') }}</span>
<el-switch v-model="vrcRegistryAskRestore" @change="setVrcRegistryAskRestore"></el-switch>
<el-switch :model-value="vrcRegistryAskRestore" @change="setVrcRegistryAskRestore"></el-switch>
</div>
<DataTable v-bind="registryBackupTable" style="margin-top: 10px">
<el-table-column :label="t('dialog.registry_backup.name')" prop="name"></el-table-column>