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-1975 Theme Framework & GH-1972 Palm Theme #517

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Remove console logs
  • Loading branch information
benstrumeyer committed Mar 26, 2020
commit 536dd7464eda02f6bb2c09b55dc499314b64dd08
@@ -87,7 +87,6 @@ export const getTheme = name => dispatch => (
sendMessageInPromise('setPanelData', { current_theme: name })
.then(() => sendMessageInPromise('account.getTheme'))
.then((res) => {
console.log('GOT THEME', res);
if (res) {
dispatch({
type: SET_THEME,
@@ -68,7 +68,6 @@ class Login extends React.Component {
this.props.actions.getUserSettings(),
])
.then((res) => {
console.log('res: ', res);
const { current_theme = 'default' } = res[1];
return this.props.actions.getTheme(current_theme);
})
@@ -130,7 +130,6 @@ class Panel extends React.Component {
const { panel, summary, blocking } = payload;
const { current_theme, account } = panel;

console.log('INIT SET THEME', current_theme);
setTheme(document, current_theme, account);

this.props.actions.updatePanelData(panel);
@@ -80,7 +80,6 @@ class Subscription extends React.Component {
changeTheme = (updated_theme) => {
this.setState({ theme: updated_theme });
this.props.actions.getTheme(updated_theme).then(() => {
console.log('updated theme: ', updated_theme);
sendMessage('ping', 'theme_change');
});
}
@@ -269,7 +269,7 @@ class Summary extends React.Component {
pageLatency = unfixedLatency.toFixed(2);
}
this.setState({ trackerLatencyTotal: pageLatency });
// reset page load value if page is reloaded while panel is open
// reset page load value if page is reloaded while panel is open
} else if (this.props.performanceData && !performanceData) {
this.setState({ trackerLatencyTotal: pageLatency });
}
@@ -77,12 +77,10 @@ export default (state = initialState, action) => {
}
case SET_THEME: {
const { name, css } = action.data;
console.log('PANEL ACTION SET THEME', name, css);
setTheme(document, name, { themeData: { [name]: { name, css } } }, true);
return Object.assign({}, state, { current_theme: name });
}
case CLEAR_THEME: {
console.log('CLEAR THEME IS CALLED');
setTheme(document, initialState.current_theme, null);
return Object.assign({}, state, { current_theme: initialState.current_theme });
}
@@ -666,7 +666,6 @@ function onMessageHandler(request, sender, callback) {
} = request;
const { tab } = sender;
const tab_id = tab && tab.id;
console.log('MESSAGE', name, message, origin);
// HANDLE PAGE EVENTS HERE
if (origin === 'account_pages') {
// Account pages
@@ -744,11 +743,8 @@ function onMessageHandler(request, sender, callback) {
return false;
}
if (name === 'account.getTheme') {
console.log('BKG::HERE 1', conf.current_theme);
if (conf.current_theme !== 'default') {
account.getTheme(conf.current_theme).then(() => {
console.log('THEME DATA', conf.account.themeData);
console.log('CALLABACK DATA', conf.account.themeData[conf.current_theme]);
callback(conf.account.themeData[conf.current_theme]);
});
return true;
ProTip! Use n and p to navigate between commits in a pull request.