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

Remove Refactoring notes from feature/cleanup and address PR comments #566

Merged
merged 6 commits into from Jun 15, 2020
Merged

Address PR Request comments

  • Loading branch information
IAmThePan committed Jun 12, 2020
commit f4f7fced7676d91b7f52db8fc157eadf1b72d3bd
@@ -268,17 +268,6 @@ export default (state = initialState, action) => {
setTheme(document);
return { ...state, current_theme: initialState.current_theme };
}
// @TODO?
// case LOGOUT_SUCCESS: {
// const notificationAction = {
// payload: {
// text: 'Logged out successfully.',
// classes: 'success',
// }
// };
// const updated = _showNotification(state, notificationAction);
// return Object.assign({}, state, updated);
// }
case RESET_PASSWORD_SUCCESS: {
const notificationAction = {
payload: {
@@ -92,20 +92,18 @@ const _exportSettings = (state, action) => {
*/
const _importSettingsDialog = (state, action) => {
const result = action.data;
let updated_actionSuccess = state.actionSuccess;
let updated_importResultText = state.importResultText;

if (result === true) {
// showBrowseWindow was successful
window.close();
} else {
updated_actionSuccess = false;
updated_importResultText = t('settings_import_dialog_error');
}

return {
actionSuccess: updated_actionSuccess,
importResultText: updated_importResultText,
return (result === true) ? {
actionSuccess: state.actionSuccess,
importResultText: state.importResultText,
} : {
actionSuccess: false,
importResultText: t('settings_import_dialog_error'),
};
};

@@ -120,15 +118,10 @@ const _importSettingsDialog = (state, action) => {
*/
const _importSettingsNative = (state, action) => {
const { settings } = action;
const updated_state = {};
const settingsKeys = Object.keys(settings);
settingsKeys.forEach((key) => {
let value = settings[key];
if (key === 'alert_bubble_timeout') {
value = (value > 30) ? 30 : value;
}
updated_state[key] = value;
});
const updated_state = { ...settings };
if (updated_state.hasOwnProperty('alert_bubble_timeout')) {
updated_state.alert_bubble_timeout = Math.min(30, updated_state.alert_bubble_timeout);
}

updated_state.settings_last_imported = Number((new Date()).getTime());
updated_state.importResultText = `${t('settings_import_success')} ${moment(updated_state.settings_last_imported).format('LLL')}`;
@@ -19,7 +19,7 @@
}

.UpgradeBanner--normal {
height: 25px;
height: 50px;

.UpgradeBanner__text {
font-size: 12px;
@@ -33,7 +33,7 @@
}

.UpgradeBanner--small {
height: 20px;
height: 50px;

.UpgradeBanner__text {
font-size: 10px;
@@ -887,6 +887,8 @@ function onMessageHandler(request, sender, callback) {
.then((foundUser) => {
const user = { user: { ...foundUser } };
if (foundUser) {
user.user.plusAccess = account.hasScopesUnverified(['subscriptions:plus'])
|| account.hasScopesUnverified(['subscriptions:premium']);
user.user.premiumAccess = account.hasScopesUnverified(['subscriptions:premium']);
}
callback(user);
ProTip! Use n and p to navigate between commits in a pull request.