Skip to content

Commit

Permalink
feat: remember path set on import page (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carson12345 authored Sep 26, 2022
1 parent e8d170a commit 251e183
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions add-on/src/popup/quick-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ function quickImportStore (state, emitter) {

emitter.on('fileInputChange', event => processFiles(state, emitter, event.target.files))

// update companion preference
emitter.on('optionChange', ({ key, value }) => {
browser.storage.local.set({ [key]: value })
})

// drag & drop anywhere
drop(document.body, files => processFiles(state, emitter, files))
}
Expand Down Expand Up @@ -138,6 +143,10 @@ async function processFiles (state, emitter, files) {
copyShareLink(results)
preloadFilesAtPublicGateway(results)

// update preferred import dir if user specified one while importing
if (state.userChangedImportDir) {
emitter.emit('optionChange', { key: 'importDir', value: state.importDir })
}
// present result to the user using the beast available way
if (!state.openViaWebUI || state.ipfsNodeType.startsWith('embedded')) {
await openFilesAtGateway(importDir)
Expand Down

0 comments on commit 251e183

Please sign in to comment.