From 9abdcb5ff7104e440d27013515b0a9f70773150c Mon Sep 17 00:00:00 2001 From: Kasper Seweryn Date: Wed, 26 Jul 2023 10:02:53 +0000 Subject: [PATCH] refactor(front): rename logger timing stop functions to `measureLoading` Part-of: --- front/src/components/favorites/List.vue | 4 ++-- front/src/components/library/Albums.vue | 4 ++-- front/src/components/library/Artists.vue | 4 ++-- front/src/components/library/Home.vue | 4 ++-- front/src/components/library/Podcasts.vue | 4 ++-- front/src/components/library/Radios.vue | 4 ++-- front/src/views/playlists/List.vue | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue index 1c917fc6e..c14d2b0e5 100644 --- a/front/src/components/favorites/List.vue +++ b/front/src/components/favorites/List.vue @@ -64,7 +64,7 @@ const fetchFavorites = async () => { ordering: orderingString.value } - const stop = logger.time('Loading user favorites') + const measureLoading = logger.time('Loading user favorites') try { const response = await axios.get('tracks/', { params }) @@ -81,7 +81,7 @@ const fetchFavorites = async () => { } catch (error) { useErrorHandler(error as Error) } finally { - stop() + measureLoading() isLoading.value = false } } diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index db9f64271..1e3f5c6b6 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -72,7 +72,7 @@ const fetchData = async () => { content_category: 'music' } - const stop = logger.time('Fetching albums') + const measureLoading = logger.time('Fetching albums') try { const response = await axios.get('albums/', { params, @@ -86,7 +86,7 @@ const fetchData = async () => { useErrorHandler(error as Error) result.value = undefined } finally { - stop() + measureLoading() isLoading.value = false } } diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index 8b2e99d7c..17f38ee3e 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -73,7 +73,7 @@ const fetchData = async () => { has_albums: excludeCompilation.value } - const stop = logger.time('Fetching artists') + const measureLoading = logger.time('Fetching artists') try { const response = await axios.get('artists/', { params, @@ -87,7 +87,7 @@ const fetchData = async () => { useErrorHandler(error as Error) result.value = undefined } finally { - stop() + measureLoading() isLoading.value = false } } diff --git a/front/src/components/library/Home.vue b/front/src/components/library/Home.vue index c2bd01223..49109f610 100644 --- a/front/src/components/library/Home.vue +++ b/front/src/components/library/Home.vue @@ -32,7 +32,7 @@ const labels = computed(() => ({ const isLoading = ref(false) const fetchData = async () => { isLoading.value = true - const stop = logger.time('Loading latest artists') + const measureLoading = logger.time('Loading latest artists') const params = { ordering: '-creation_date', @@ -47,7 +47,7 @@ const fetchData = async () => { } isLoading.value = false - stop() + measureLoading() } fetchData() diff --git a/front/src/components/library/Podcasts.vue b/front/src/components/library/Podcasts.vue index 35a9e4596..0925a802d 100644 --- a/front/src/components/library/Podcasts.vue +++ b/front/src/components/library/Podcasts.vue @@ -74,7 +74,7 @@ const fetchData = async () => { content_category: 'podcast' } - const stop = logger.time('Fetching podcasts') + const measureLoading = logger.time('Fetching podcasts') try { const response = await axios.get('artists/', { params, @@ -88,7 +88,7 @@ const fetchData = async () => { useErrorHandler(error as Error) result.value = undefined } finally { - stop() + measureLoading() isLoading.value = false } } diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 145f91116..f12b41b39 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -64,7 +64,7 @@ const fetchData = async () => { ordering: orderingString.value } - const stop = logger.time('Fetching radios') + const measureLoading = logger.time('Fetching radios') try { const response = await axios.get('radios/radios/', { params @@ -75,7 +75,7 @@ const fetchData = async () => { useErrorHandler(error as Error) result.value = undefined } finally { - stop() + measureLoading() isLoading.value = false } } diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index 99e4d74be..bcd463bf7 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -65,7 +65,7 @@ const fetchData = async () => { playable: true } - const stop = logger.time('Fetching albums') + const measureLoading = logger.time('Fetching albums') try { const response = await axios.get('playlists/', { params @@ -76,7 +76,7 @@ const fetchData = async () => { useErrorHandler(error as Error) result.value = undefined } finally { - stop() + measureLoading() isLoading.value = false } }