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 {
|
isMonthView(): boolean {
|
||||||
if (this.$route.query.sort === 'timeline') return false;
|
if (this.$route.query.sort === 'timeline') return false;
|
||||||
|
if (this.$route.query.sort === 'album') return true;
|
||||||
return (
|
return (
|
||||||
this.$route.query.sort === 'album' ||
|
(this.config.sort_album_month && (this.routeIsAlbums || this.routeIsAlbumShare)) ||
|
||||||
(this.config.sort_album_month && (this.$route.name === 'albums' || this.$route.name === 'album-share')) ||
|
(this.config.sort_folder_month && this.routeIsFolders)
|
||||||
(this.config.sort_folder_month && this.$route.name === 'folders')
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,9 @@ export default defineComponent({
|
||||||
routeIsExplore(): boolean {
|
routeIsExplore(): boolean {
|
||||||
return this.$route.name === 'explore';
|
return this.$route.name === 'explore';
|
||||||
},
|
},
|
||||||
|
routeIsAlbumShare(): boolean {
|
||||||
|
return this.$route.name === 'album-share';
|
||||||
|
},
|
||||||
routeIsPublic(): boolean {
|
routeIsPublic(): boolean {
|
||||||
return this.$route.name?.endsWith('-share') ?? false;
|
return this.$route.name?.endsWith('-share') ?? false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,6 +22,7 @@ declare module 'vue' {
|
||||||
routeIsMap: boolean;
|
routeIsMap: boolean;
|
||||||
routeIsTags: boolean;
|
routeIsTags: boolean;
|
||||||
routeIsExplore: boolean;
|
routeIsExplore: boolean;
|
||||||
|
routeIsAlbumShare: boolean;
|
||||||
routeIsPublic: boolean;
|
routeIsPublic: boolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue