Skip to content

Commit

Permalink
Added View App Data back to help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
smpallen99 committed Jun 22, 2018
1 parent 1183906 commit 99e421b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 21 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# InfinityOne-Electron Changelog

## 1.0.0.rc (2018-06-22)

### Enhancements

### Bug Fixes

* Fixed application hang on domains.json parse error
* Added View App Data back to help menu
* Fixed a couple JS errors due to undefined variables

8 changes: 4 additions & 4 deletions app/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ class AppMenu {
label: `${appName + ' Desktop-'} v${app.getVersion()}`,
enabled: false
}, {
label: 'Show App Data',
click() {
shell.openItem(app.getPath('userData'));
}
label: 'Show App Data',
click() {
shell.openItem(app.getPath('userData'));
}
}
];
}
Expand Down
19 changes: 13 additions & 6 deletions app/renderer/js/components/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ class WebView extends BaseComponent {
const { url } = event;
const domainPrefix = DomainUtil.getDomain(this.props.index).url;

if (LinkUtil.isInternal(domainPrefix, url) || url === (domainPrefix + '/')) {
event.preventDefault();
this.$el.loadURL(url);
} else {
event.preventDefault();
shell.openExternal(url);
try {
if (LinkUtil.isInternal(domainPrefix, url) || url === (domainPrefix + '/')) {
event.preventDefault();
this.$el.loadURL(url);
} else {
event.preventDefault();
shell.openExternal(url);
}
} catch (err) {
console.warn('error registering listeners');
}
});

Expand Down Expand Up @@ -92,6 +96,7 @@ class WebView extends BaseComponent {
});

this.$el.addEventListener('dom-ready', () => {
console.log('dom-ready');
if (this.props.role === 'server') {
this.$el.classList.add('onload');
}
Expand All @@ -101,13 +106,15 @@ class WebView extends BaseComponent {
this.$el.addEventListener('did-fail-load', event => {
const { errorDescription } = event;
const hasConnectivityErr = (SystemUtil.connectivityERR.indexOf(errorDescription) >= 0);
console.log('dom-fail-load', event, errorDescription, hasConnectivityErr);
if (hasConnectivityErr) {
console.error('error', errorDescription);
this.props.onNetworkError();
}
});

this.$el.addEventListener('did-start-loading', () => {
console.log('dom-start-loading');
let userAgent = SystemUtil.getUserAgent();
if (!userAgent) {
SystemUtil.setUserAgent(this.$el.getUserAgent());
Expand Down
10 changes: 7 additions & 3 deletions app/renderer/js/notification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ if (process.platform === 'darwin') {
window.addEventListener('load', () => {
setNotificationCallback2(Notification);

window.one_chat.notifier.audioEnabled = () => {
return !(ConfigUtil.getConfigItem('silent') || false);
};
if (typeof window.one_chat !== 'undefined' && typeof window.one_chat.notifier !== 'undefined') {
window.one_chat.notifier.audioEnabled = () => {
return !(ConfigUtil.getConfigItem('silent') || false);
};
} else {
console.warn('window.one_chat.notifier is not defined');
}
});
16 changes: 10 additions & 6 deletions app/renderer/js/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ process.once('loaded', () => {
// To prevent failing this script on linux we need to load it after the document loaded
document.addEventListener('DOMContentLoaded', () => {
// Get the default language of the server
const serverLanguage = page_params.default_language; // eslint-disable-line no-undef, camelcase
if (typeof page_params === 'undefined') {
console.log('page_params is not defined');
} else {
const serverLanguage = page_params.default_language; // eslint-disable-line no-undef, camelcase

if (serverLanguage) {
// Set spellcheker language
ConfigUtil.setConfigItem('spellcheckerLanguage', serverLanguage);
// Init spellchecker
SetupSpellChecker.init();
if (serverLanguage) {
// Set spellcheker language
ConfigUtil.setConfigItem('spellcheckerLanguage', serverLanguage);
// Init spellchecker
SetupSpellChecker.init();
}
}

// redirect users to network troubleshooting page
Expand Down
3 changes: 1 addition & 2 deletions app/renderer/js/utils/domain-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ class DomainUtil {
alias: data.realm_name
});
}
}
catch(err) {
} catch (err) {
reject('Infinity One server invalid response');
}
} else {
Expand Down

0 comments on commit 99e421b

Please sign in to comment.