mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	feat: PlaylistAddModal switches to created playlist
This commit is contained in:
		
							parent
							
								
									34f52c953e
								
							
						
					
					
						commit
						6311eb73de
					
				
					 2 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -43,7 +43,7 @@ export default {
 | 
				
			||||||
            this.createPlaylist(this.playlistName).then(response => {
 | 
					            this.createPlaylist(this.playlistName).then(response => {
 | 
				
			||||||
                if (response.error) alert(response.error);
 | 
					                if (response.error) alert(response.error);
 | 
				
			||||||
                else {
 | 
					                else {
 | 
				
			||||||
                    this.$emit("created");
 | 
					                    this.$emit("created", response.playlistId, this.playlistName);
 | 
				
			||||||
                    this.$emit("close");
 | 
					                    this.$emit("close");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,7 @@
 | 
				
			||||||
    <CreatePlaylistModal
 | 
					    <CreatePlaylistModal
 | 
				
			||||||
        v-if="showCreatePlaylistModal"
 | 
					        v-if="showCreatePlaylistModal"
 | 
				
			||||||
        @close="showCreatePlaylistModal = false"
 | 
					        @close="showCreatePlaylistModal = false"
 | 
				
			||||||
        @created="fetchPlaylists"
 | 
					        @created="addCreatedPlaylist"
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,7 +55,9 @@ export default {
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
        this.fetchPlaylists();
 | 
					        this.getPlaylists().then(json => {
 | 
				
			||||||
 | 
					            this.playlists = json;
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
        this.selectedPlaylist = this.getPreferenceString("selectedPlaylist" + this.hashCode(this.authApiUrl()));
 | 
					        this.selectedPlaylist = this.getPreferenceString("selectedPlaylist" + this.hashCode(this.authApiUrl()));
 | 
				
			||||||
        window.addEventListener("keydown", this.handleKeyDown);
 | 
					        window.addEventListener("keydown", this.handleKeyDown);
 | 
				
			||||||
        window.blur();
 | 
					        window.blur();
 | 
				
			||||||
| 
						 | 
					@ -87,10 +89,9 @@ export default {
 | 
				
			||||||
                if (json.error) alert(json.error);
 | 
					                if (json.error) alert(json.error);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async fetchPlaylists() {
 | 
					        addCreatedPlaylist(playlistId, playlistName) {
 | 
				
			||||||
            this.getPlaylists().then(json => {
 | 
					            this.playlists.push({ id: playlistId, name: playlistName });
 | 
				
			||||||
                this.playlists = json;
 | 
					            this.selectedPlaylist = playlistId;
 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue