Bug Fix: Change how bad playlist setup is handled
Reset to defaults if no columns are visible. Also log this situation in Firebase events, in case it becomes relevant. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
4face7d631
commit
f239784bf2
1 changed files with 11 additions and 7 deletions
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#import "Logging.h"
|
#import "Logging.h"
|
||||||
|
|
||||||
|
@import Firebase;
|
||||||
|
|
||||||
static NSString *playlistSavedColumnsID = @"Playlist Saved Columns v0";
|
static NSString *playlistSavedColumnsID = @"Playlist Saved Columns v0";
|
||||||
|
|
||||||
@implementation PlaylistView
|
@implementation PlaylistView
|
||||||
|
@ -152,14 +154,16 @@ static NSString *playlistSavedColumnsID = @"Playlist Saved Columns v0";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(visibleTableColumns == 0) {
|
if(visibleTableColumns == 0) {
|
||||||
|
// Reset to defaults
|
||||||
|
NSString *message = @"Reset playlist columns to default";
|
||||||
|
DLog(@"%@", message);
|
||||||
|
[[FIRCrashlytics crashlytics] logWithFormat:@"%@", message];
|
||||||
for(NSTableColumn *col in columns) {
|
for(NSTableColumn *col in columns) {
|
||||||
NSString *columnID = [col identifier];
|
[self removeTableColumn:col];
|
||||||
NSUInteger index = [defaultColumnList indexOfObject:columnID];
|
|
||||||
if(index != NSNotFound) {
|
|
||||||
id column = [defaultColumns objectAtIndex:index];
|
|
||||||
[col setWidth:[[column objectForKey:@"width"] unsignedIntegerValue]];
|
|
||||||
[col setHidden:[[column objectForKey:@"hidden"] boolValue]];
|
|
||||||
}
|
}
|
||||||
|
columns = oldColumns;
|
||||||
|
for(NSTableColumn *col in columns) {
|
||||||
|
[self addTableColumn:col];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue