Skip to content

Commit

Permalink
feat: redirect if there's only one collection
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Jan 24, 2024
1 parent 497c035 commit 7dbfea6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export default defineComponent({
});
await this.fetchArticleCounts();
// Redirect if there's only one collection
if (this.chronosConfig!.chronosCollections.length === 1) {
const collection = this.chronosConfig!.chronosCollections[0];
this.$router.replace(`/collections/${collection.shortName}`);
}
},
methods: {
async fetchArticleCounts() {
Expand Down

0 comments on commit 7dbfea6

Please sign in to comment.