diff --git a/desktop/app/src/dispatcher/pluginDownloads.tsx b/desktop/app/src/dispatcher/pluginDownloads.tsx index f246afd08..8257d6bcc 100644 --- a/desktop/app/src/dispatcher/pluginDownloads.tsx +++ b/desktop/app/src/dispatcher/pluginDownloads.tsx @@ -116,7 +116,7 @@ async function handlePluginDownload( }); if (response.headers['content-type'] !== 'application/octet-stream') { throw new Error( - `Unexpected content type ${response.headers['content-type']} received from ${plugin.downloadUrl}`, + `It looks like you are not on VPN/Lighthouse. Unexpected content type received: ${response.headers['content-type']}.`, ); } const responseStream = response.data as fs.ReadStream; @@ -149,6 +149,7 @@ async function handlePluginDownload( if (startedByUser) { showErrorNotification( `Failed to download plugin "${title}" v${version}.`, + 'Please check that you are on VPN/Lighthouse.', ); } throw error; diff --git a/desktop/app/src/utils/notifications.tsx b/desktop/app/src/utils/notifications.tsx index 4e1317133..72b1b1945 100644 --- a/desktop/app/src/utils/notifications.tsx +++ b/desktop/app/src/utils/notifications.tsx @@ -12,20 +12,31 @@ import React from 'react'; import {ConsoleLogs} from '../chrome/ConsoleLogs'; import {setStaticView} from '../reducers/connections'; import {store} from '../store'; +import {Layout} from '../ui'; +import {v4 as uuid} from 'uuid'; -const {Text, Link} = Typography; +const {Link} = Typography; -export function showErrorNotification(message: string) { +export function showErrorNotification(message: string, description?: string) { + const key = uuid(); notification.error({ + key, message, description: ( - - See{' '} - store.dispatch(setStaticView(ConsoleLogs))}> - logs - {' '} - for details. - + + {description ??

{description}

} +

+ See{' '} + { + store.dispatch(setStaticView(ConsoleLogs)); + notification.close(key); + }}> + logs + {' '} + for details. +

+
), placement: 'bottomLeft', });