From 72eed15cc4e413db1cfc0e07dc53fe35b2ca06ff Mon Sep 17 00:00:00 2001 From: Jonathan Poltak Samosir Date: Fri, 6 Apr 2018 11:40:18 +0700 Subject: [PATCH] Add notif on import start - just suggestion text for now; will change - links to main knowledge base page until we write article/blog post --- src/imports/background/connection-handler.js | 8 ++++++++ src/imports/background/constants.ts | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 src/imports/background/constants.ts diff --git a/src/imports/background/connection-handler.js b/src/imports/background/connection-handler.js index ff6fd1dcdf..f141facf06 100644 --- a/src/imports/background/connection-handler.js +++ b/src/imports/background/connection-handler.js @@ -1,4 +1,6 @@ import { CMDS, DEF_CONCURRENCY } from 'src/options/imports/constants' +import { WARN_NOTIF, WARN_INFO_URL } from './constants' +import createNotif from 'src/util/notifications' import ProgressManager from './progress-manager' import stateManager from './state-manager' @@ -108,6 +110,12 @@ export default class ImportConnectionHandler { * or not to process that given type of imports. */ async startImport(allowTypes) { + if (!this._quickMode) { + createNotif(WARN_NOTIF, () => + browser.tabs.create({ url: WARN_INFO_URL }), + ) + } + stateManager.allowTypes = allowTypes if (!await this.getImportInProgressFlag()) { diff --git a/src/imports/background/constants.ts b/src/imports/background/constants.ts new file mode 100644 index 0000000000..c2cd52d9fb --- /dev/null +++ b/src/imports/background/constants.ts @@ -0,0 +1,7 @@ +export const WARN_NOTIF = { + title: 'Memex Importer', + message: + 'The importer may be stopped by the browser at any time. Click here for more info', +} + +export const WARN_INFO_URL = 'https://worldbrain.helprace.com/'