Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Remove error toast after autoupdate - Closes #1062 #1068

Merged
merged 3 commits into from
May 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/utils/externalLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ export default {

if (ipc) {
ipc.on('openUrl', (action, url) => {
const normalizedUrl = url.toLowerCase().replace('lisk://', '/');
const route = routesReg.find(item => item.regex.test(normalizedUrl));
if (route !== undefined) {
history.push(normalizedUrl);
} else {
store.dispatch(errorToastDisplayed({ label: i18next.t('The URL was invalid') }));
const protocol = url.split(':/')[0];
const normalizedUrl = url.split(':/')[1];
if (protocol && protocol.toLowerCase() === 'lisk' && normalizedUrl) {
const route = routesReg.find(item => item.regex.test(normalizedUrl));
if (route !== undefined) {
history.push(normalizedUrl);
} else {
store.dispatch(errorToastDisplayed({ label: i18next.t('The URL was invalid') }));
}
}
});
}
Expand Down