albums: rename list sorting

pull/461/head
Varun Patil 2023-03-03 14:23:44 -08:00
parent b63a79385d
commit e23ed4c260
4 changed files with 10 additions and 8 deletions

View File

@ -753,7 +753,7 @@ export default defineComponent({
if (this.$route.name === "thisday") {
data = await dav.getOnThisDayData();
} else if (this.$route.name === "albums" && !this.$route.params.name) {
data = await dav.getAlbumsData(3, this.config_albumSort);
data = await dav.getAlbumsData(3, this.config_albumListSort);
} else if (this.routeIsPeople && !this.$route.params.name) {
data = await dav.getPeopleData(this.$route.name as any);
} else if (this.$route.name === "places" && !this.$route.params.name) {

View File

@ -18,7 +18,7 @@
<NcActionRadio
name="sort"
:aria-label="t('memories', 'Sort by date')"
:checked="config_albumSort === 1"
:checked="config_albumListSort === 1"
@change="changeSort(1)"
close-after-click
>
@ -29,7 +29,7 @@
<NcActionRadio
name="sort"
:aria-label="t('memories', 'Sort by name')"
:checked="config_albumSort === 2"
:checked="config_albumListSort === 2"
@change="changeSort(2)"
close-after-click
>
@ -200,8 +200,8 @@ export default defineComponent({
* 1 = date, 2 = name
*/
changeSort(order: 1 | 2) {
this.config_albumSort = order;
this.updateSetting("albumSort");
this.config_albumListSort = order;
this.updateSetting("albumListSort");
},
},
});

View File

@ -5,7 +5,7 @@ import { API } from "../services/API";
import { defineComponent } from "vue";
const eventName = "memories:user-config-changed";
const localSettings = ["squareThumbs", "showFaceRect", "albumSort"];
const localSettings = ["squareThumbs", "showFaceRect", "albumListSort"];
export default defineComponent({
name: "UserConfig",
@ -45,7 +45,9 @@ export default defineComponent({
config_squareThumbs: localStorage.getItem("memories_squareThumbs") === "1",
config_showFaceRect: localStorage.getItem("memories_showFaceRect") === "1",
config_albumSort: Number(localStorage.getItem("memories_albumSort") || 1),
config_albumListSort: Number(
localStorage.getItem("memories_albumListSort") || 1
),
config_eventName: eventName,
}),

View File

@ -26,7 +26,7 @@ declare module "vue" {
config_squareThumbs: boolean;
config_enableTopMemories: boolean;
config_showFaceRect: boolean;
config_albumSort: 1 | 2;
config_albumListSort: 1 | 2;
config_eventName: string;
updateSetting(setting: string): Promise<void>;