mirror of https://github.com/gorhill/uBlock.git
Discard duplicate lines when merging imported directives
Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/tqwl4s/import_of_the_reliable_sites/
This commit is contained in:
parent
ecfe47a1ef
commit
0d6a459b60
|
@ -178,9 +178,11 @@ const handleImportFilePicker = function() {
|
||||||
const fr = new FileReader();
|
const fr = new FileReader();
|
||||||
fr.onload = ev => {
|
fr.onload = ev => {
|
||||||
if ( ev.type !== 'load' ) { return; }
|
if ( ev.type !== 'load' ) { return; }
|
||||||
setEditorText(
|
const content = uBlockDashboard.mergeNewLines(
|
||||||
[ getEditorText().trim(), fr.result.trim() ].join('\n').trim()
|
getEditorText().trim(),
|
||||||
|
fr.result.trim()
|
||||||
);
|
);
|
||||||
|
setEditorText(content);
|
||||||
};
|
};
|
||||||
fr.readAsText(file);
|
fr.readAsText(file);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue