From e23ed4c260228dece05764a167908443af05d33b Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 3 Mar 2023 14:23:44 -0800 Subject: [PATCH] albums: rename list sorting --- src/components/Timeline.vue | 2 +- src/components/top-matter/AlbumTopMatter.vue | 8 ++++---- src/mixins/UserConfig.ts | 6 ++++-- src/vue-globals.d.ts | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index 76921a7a..858386a8 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -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) { diff --git a/src/components/top-matter/AlbumTopMatter.vue b/src/components/top-matter/AlbumTopMatter.vue index daa867f4..eed1b74c 100644 --- a/src/components/top-matter/AlbumTopMatter.vue +++ b/src/components/top-matter/AlbumTopMatter.vue @@ -18,7 +18,7 @@ @@ -29,7 +29,7 @@ @@ -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"); }, }, }); diff --git a/src/mixins/UserConfig.ts b/src/mixins/UserConfig.ts index a05a503c..91b59a80 100644 --- a/src/mixins/UserConfig.ts +++ b/src/mixins/UserConfig.ts @@ -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, }), diff --git a/src/vue-globals.d.ts b/src/vue-globals.d.ts index 845f841e..e16e7eef 100644 --- a/src/vue-globals.d.ts +++ b/src/vue-globals.d.ts @@ -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;