Skip to content

Commit

Permalink
Add notif on import start
Browse files Browse the repository at this point in the history
- just suggestion text for now; will change
- links to main knowledge base page until we write article/blog post
  • Loading branch information
poltak committed Apr 6, 2018
1 parent b95ad51 commit 72eed15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/imports/background/connection-handler.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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()) {
Expand Down
7 changes: 7 additions & 0 deletions src/imports/background/constants.ts
Original file line number Diff line number Diff line change
@@ -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/'

0 comments on commit 72eed15

Please sign in to comment.