Skip to content

Commit

Permalink
Add requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <obulat@gmail.com>
  • Loading branch information
obulat committed Dec 1, 2023
1 parent 58d540b commit cb01698
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/VCollectionPage.vue
@@ -1,5 +1,5 @@
<template>
<div class="p-6 lg:p-10">
<div class="p-6 pt-0 lg:p-10 lg:pt-2">
<VCollectionHeader
v-if="collectionParams"
:collection-params="collectionParams"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/VLoadMore.vue
Expand Up @@ -46,11 +46,11 @@ export default defineComponent({
storeToRefs(mediaStore)
const { searchTerm } = storeToRefs(searchStore)
const searchStarted = computed(() =>
searchStore.strategy === "default"
const searchStarted = computed(() => {
return searchStore.strategy === "default"
? searchTerm.value !== ""
: searchStore.collectionParams !== null
)
})
/**
* Whether we should show the "Load more" button.
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/utils/validate-collection-params.ts
Expand Up @@ -11,6 +11,18 @@ import { useProviderStore } from "~/stores/provider"
import { warn } from "~/utils/console"
import { useFeatureFlagStore } from "~/stores/feature-flag"

/**
* Validate the params for a collection page.
*
* @param firstParam - The first param in the path, either "tag" or "source".
* If the first param is "source", the collection is either a source collection
* or a creator collection.
* @param mediaType - The media type of the collection.
* @param params - `params.pathMatch` is the part of the path after the collection name:
* `/sourceName` or `/sourceName/creator/creatorName`.
* @param $pinia - Pinia instance, necessary to check the feature flag, and validate the
* sources using providerStore.
*/
export function validateCollectionParams({
firstParam,
mediaType,
Expand Down

0 comments on commit cb01698

Please sign in to comment.