Skip to content

Commit

Permalink
add better notification about a bug
Browse files Browse the repository at this point in the history
and fix bug with no playlists
  • Loading branch information
jplsek committed Aug 9, 2018
1 parent db529f5 commit a7ceab7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/stored.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ return {

var html = '';

if (!Array.isArray(playlists))
playlists = [playlists];
playlists = mpcp.utils.toArray(playlists);

if (!playlists.length) {
html = '<em class="gen text-muted">No saved playlists</em>';
Expand Down Expand Up @@ -212,7 +211,11 @@ return {
mpcp.lazyToast.error('Is there a playlist directory and correct write permissions?', 'Cannot read playlist directory!');
} else if (notFound) {
// read MESSAGE1
mpcp.lazyToast.error('File not found: ' + err2, 'Playlist');
if (err2 == undefined) {
mpcp.lazyToast.warning('Hmmm a known bug was triggered. (A song was undefined when it should be defined.) Double check that your playlist was saved before closing!');
} else {
mpcp.lazyToast.error('File not found: ' + err2, 'Playlist');
}
} else if (unknown) {
mpcp.lazyToast.error(err2, 'Unhandled Error');
}
Expand Down

0 comments on commit a7ceab7

Please sign in to comment.