Skip to content

Commit 251e183

Browse files
authored
feat: remember path set on import page (#1063)
1 parent e8d170a commit 251e183

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

add-on/src/popup/quick-import.js

+9
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ function quickImportStore (state, emitter) {
6161

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

64+
// update companion preference
65+
emitter.on('optionChange', ({ key, value }) => {
66+
browser.storage.local.set({ [key]: value })
67+
})
68+
6469
// drag & drop anywhere
6570
drop(document.body, files => processFiles(state, emitter, files))
6671
}
@@ -138,6 +143,10 @@ async function processFiles (state, emitter, files) {
138143
copyShareLink(results)
139144
preloadFilesAtPublicGateway(results)
140145

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

0 commit comments

Comments
 (0)