Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1071 - Remove cap on showing of banners #74

Merged
merged 5 commits into from May 23, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Additional fixes for GH-1071
  • Loading branch information
zarembsky committed May 22, 2018
commit 052b75cc52d0fd402e5fa3c145626dde0dc6c2a4
@@ -242,7 +242,7 @@ const _showNotification = (state, action) => {
*/
const _closeNotification = (state, action) => {
return {
notificationShown: (action.data.banner_status_name === 'temp_banner_status') ? false : true
notificationShown: false
};
};

@@ -75,6 +75,15 @@ const handler = {
}
}

//Adjust banner statuses, as they used to be objects
//while now they are booleans. This filter covers syncing.
if (key === 'reload_banner_status' ||
key === 'trackers_banner_status') {
if(value && (typeof value === 'object')) {
value = !!value.show;
}
}

target[key] = value;

// Don't save to storage while background::init() called.
@@ -77,6 +77,22 @@ class ConfData {
_setProp('previous_version', this.previous_version);
}

// Transfer legacy banner statuses which used to be objects
const { reload_banner_status, trackers_banner_status} = data;
if(reload_banner_status && typeof reload_banner_status === 'object') {
this.reload_banner_status = !!reload_banner_status.show;
_setProp('reload_banner_status', this.reload_banner_status);
} else {
_initProperty('reload_banner_status', true);
}

if(trackers_banner_status && typeof trackers_banner_status === 'object') {
this.trackers_banner_status = !!trackers_banner_status.show;
_setProp('trackers_banner_status', this.trackers_banner_status);
} else {
_initProperty('trackers_banner_status', true);
}

// simple props
_initProperty('alert_bubble_pos', 'br');
_initProperty('alert_bubble_timeout', 15);
@@ -116,8 +132,6 @@ class ConfData {
_initProperty('setup_step', 0);
_initProperty('setup_path', 0);
_initProperty('setup_block', 1);
_initProperty('reload_banner_status', true);
_initProperty('trackers_banner_status', true);

// Complex props
_initProperty('bugs', {});
ProTip! Use n and p to navigate between commits in a pull request.