Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
fix(App): Remove gaEvent and fix theme not loading on start
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDabrowski committed Feb 4, 2019
1 parent ab68b96 commit bf502e6
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "franz",
"productName": "Franz",
"appId": "com.meetfranz.franz",
"version": "5.0.0-omega.24",
"version": "5.0.0-omega.25",
"description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.",
"copyright": "adlk x franz - Stefan Malzner",
"main": "index.js",
Expand Down
1 change: 0 additions & 1 deletion src/containers/auth/ImportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import UserStore from '../../stores/UserStore';

export default @inject('stores', 'actions') @observer class ImportScreen extends Component {
componentDidMount() {
gaPage('Auth/Import');
}

render() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/auth/InviteScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Invite from '../../components/auth/Invite';

export default @inject('stores', 'actions') @observer class InviteScreen extends Component {
componentDidMount() {
gaPage('Auth/Invite');
}

render() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/auth/PasswordScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import UserStore from '../../stores/UserStore';

export default @inject('stores', 'actions') @observer class PasswordScreen extends Component {
componentDidMount() {
gaPage('Auth/Password Retrieve');
}

render() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/auth/WelcomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import RecipePreviewsStore from '../../stores/RecipePreviewsStore';

export default @inject('stores', 'actions') @observer class LoginScreen extends Component {
componentDidMount() {
gaPage('Auth/Welcome');
}

render() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/settings/AccountScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const { BrowserWindow } = remote;

export default @inject('stores', 'actions') @observer class AccountScreen extends Component {
componentDidMount() {
gaPage('Settings/Account Dashboard');
}

onCloseWindow() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/settings/InviteScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ErrorBoundary from '../../components/util/ErrorBoundary';

export default @inject('stores', 'actions') @observer class InviteScreen extends Component {
componentDidMount() {
gaPage('Settings/Invite');
}

componentWillUnmount() {
Expand Down
1 change: 0 additions & 1 deletion src/containers/settings/ServicesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ErrorBoundary from '../../components/util/ErrorBoundary';

export default @inject('stores', 'actions') @observer class ServicesScreen extends Component {
componentDidMount() {
gaPage('Settings/Service Dashboard');
}

componentWillUnmount() {
Expand Down
47 changes: 34 additions & 13 deletions src/webview/lib/RecipeWebview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,42 @@ class RecipeWebview {
}

changeTheme = (themeName) => {
const currentClassList = document.body.classList;
if (themeName && !currentClassList.contains(themeName)) {
let name = themeName;
if (!themeName.startsWith('theme-')) {
name = `theme-${themeName}`;
}
[...currentClassList].forEach((c) => {
if (c && c.startsWith('theme-')) {
document.body.classList.remove(c);
if(document.body && document.body.classList) {
const currentClassList = document.body.classList;
if (themeName && !currentClassList.contains(themeName)) {
let name = themeName;
if (!themeName.startsWith('theme-')) {
name = `theme-${themeName}`;
}
[...currentClassList].forEach((c) => {
if (c && c.startsWith('theme-')) {
document.body.classList.remove(c);
}
});
if (name === 'theme-regular') {
return;
}
});
if (name === 'theme-regular') {
return;
document.body.classList.add(name);
}
document.body.classList.add(name);
} else {
window.addEventListener('load', () => {
const currentClassList = document.body.classList;
if (themeName && !currentClassList.contains(themeName)) {
let name = themeName;
if (!themeName.startsWith('theme-')) {
name = `theme-${themeName}`;
}
[...currentClassList].forEach((c) => {
if (c && c.startsWith('theme-')) {
document.body.classList.remove(c);
}
});
if (name === 'theme-regular') {
return;
}
document.body.classList.add(name);
}
})
}
};

Expand Down

0 comments on commit bf502e6

Please sign in to comment.