1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-23 10:52:43 +01:00

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:
Raymond Hill 2022-03-29 09:49:17 -04:00
parent ecfe47a1ef
commit 0d6a459b60
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -178,9 +178,11 @@ const handleImportFilePicker = function() {
const fr = new FileReader();
fr.onload = ev => {
if ( ev.type !== 'load' ) { return; }
setEditorText(
[ getEditorText().trim(), fr.result.trim() ].join('\n').trim()
const content = uBlockDashboard.mergeNewLines(
getEditorText().trim(),
fr.result.trim()
);
setEditorText(content);
};
fr.readAsText(file);
};