refactor: more route check functions
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/767/head
parent
6958a678b9
commit
2d54b502a9
|
@ -214,10 +214,10 @@ export default defineComponent({
|
|||
|
||||
isMonthView(): boolean {
|
||||
if (this.$route.query.sort === 'timeline') return false;
|
||||
if (this.$route.query.sort === 'album') return true;
|
||||
return (
|
||||
this.$route.query.sort === 'album' ||
|
||||
(this.config.sort_album_month && (this.$route.name === 'albums' || this.$route.name === 'album-share')) ||
|
||||
(this.config.sort_folder_month && this.$route.name === 'folders')
|
||||
(this.config.sort_album_month && (this.routeIsAlbums || this.routeIsAlbumShare)) ||
|
||||
(this.config.sort_folder_month && this.routeIsFolders)
|
||||
);
|
||||
},
|
||||
|
||||
|
|
|
@ -46,6 +46,9 @@ export default defineComponent({
|
|||
routeIsExplore(): boolean {
|
||||
return this.$route.name === 'explore';
|
||||
},
|
||||
routeIsAlbumShare(): boolean {
|
||||
return this.$route.name === 'album-share';
|
||||
},
|
||||
routeIsPublic(): boolean {
|
||||
return this.$route.name?.endsWith('-share') ?? false;
|
||||
},
|
||||
|
|
|
@ -22,6 +22,7 @@ declare module 'vue' {
|
|||
routeIsMap: boolean;
|
||||
routeIsTags: boolean;
|
||||
routeIsExplore: boolean;
|
||||
routeIsAlbumShare: boolean;
|
||||
routeIsPublic: boolean;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue