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
cd83dfa87c
commit
df74a068dc
1 changed files with 11 additions and 7 deletions
|
@ -16,6 +16,8 @@
|
|||
|
||||
#import "Logging.h"
|
||||
|
||||
@import Firebase;
|
||||
|
||||
static NSString *playlistSavedColumnsID = @"Playlist Saved Columns v0";
|
||||
|
||||
@implementation PlaylistView
|
||||
|
@ -152,14 +154,16 @@ static NSString *playlistSavedColumnsID = @"Playlist Saved Columns v0";
|
|||
}
|
||||
|
||||
if(visibleTableColumns == 0) {
|
||||
// Reset to defaults
|
||||
NSString *message = @"Reset playlist columns to default";
|
||||
DLog(@"%@", message);
|
||||
[[FIRCrashlytics crashlytics] logWithFormat:@"%@", message];
|
||||
for(NSTableColumn *col in columns) {
|
||||
NSString *columnID = [col identifier];
|
||||
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]];
|
||||
}
|
||||
[self removeTableColumn:col];
|
||||
}
|
||||
columns = oldColumns;
|
||||
for(NSTableColumn *col in columns) {
|
||||
[self addTableColumn:col];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue