Don't try to add an album if the user cancels

This commit is contained in:
Timothy Farrell 2017-11-21 23:51:31 -06:00
parent afb8734835
commit 43a20c4afe

View File

@ -37,12 +37,15 @@ export function GalleryView(vm, model) {
} }
function addAlbum() { function addAlbum() {
const albumName = prompt('Album Name');
if (albumName && albumName.trim()) {
const a = new AlbumType({ const a = new AlbumType({
title: prompt('Album Name'), title: albumName.trim(),
members: [] count: 0
}); });
a.save(); a.save();
} }
}
routeChanged.subscribe(function onRouteChange(router, route) { routeChanged.subscribe(function onRouteChange(router, route) {
if (laCleanup) { if (laCleanup) {