File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -82,19 +82,23 @@ export const useAlbumStore = defineStore("album-store", {
8282 if ( data . data . resource === null ) {
8383 return ;
8484 }
85+ // Reset to avoid bad surprises.
86+ albumsStore . albums = [ ] ;
87+ albumsStore . tagAlbums = [ ] ;
88+ albumsStore . pinnedAlbums = [ ] ;
89+ albumsStore . sharedAlbums = [ ] ;
90+ // Load data.
8591 if ( data . data . config . is_model_album ) {
8692 this . modelAlbum = data . data . resource as App . Http . Resources . Models . AlbumResource ;
8793 albumsStore . albums = this . modelAlbum . albums ;
8894 } else if ( data . data . config . is_base_album ) {
8995 this . tagAlbum = data . data . resource as App . Http . Resources . Models . TagAlbumResource ;
90- albumsStore . albums = [ ] ; // Reset to avoid bad surprises.
9196 } else {
9297 this . smartAlbum = data . data . resource as App . Http . Resources . Models . SmartAlbumResource ;
9398 this . per_page = this . smartAlbum . per_page ;
9499 this . total = this . smartAlbum . total ;
95100 this . current_page = this . smartAlbum . current_page ;
96101 this . last_page = this . smartAlbum . last_page ;
97- albumsStore . albums = [ ] ; // Reset to avoid bad surprises.
98102 }
99103 photosState . setPhotos ( data . data . resource . photos , data . data . config . is_photo_timeline_enabled ) ;
100104 } )
You can’t perform that action at this time.
0 commit comments