mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
ImportHandler: Use truthiness to signal conversion handled
This commit is contained in:
parent
edf99dc811
commit
caf4e9f28c
2 changed files with 4 additions and 7 deletions
|
@ -142,11 +142,8 @@ const doImport = async (req, res, padId) => {
|
|||
}
|
||||
|
||||
const destFile = path.join(tmpDirectory, `etherpad_import_${randNum}.${exportExtension}`);
|
||||
|
||||
// Logic for allowing external Import Plugins
|
||||
const result = await hooks.aCallAll('import', {srcFile, destFile, fileEnding});
|
||||
const importHandledByPlugin = (result.length > 0); // This feels hacky and wrong..
|
||||
|
||||
const importHandledByPlugin =
|
||||
(await hooks.aCallAll('import', {srcFile, destFile, fileEnding})).some((x) => x);
|
||||
const fileIsEtherpad = (fileEnding === '.etherpad');
|
||||
const fileIsHTML = (fileEnding === '.html' || fileEnding === '.htm');
|
||||
const fileIsTXT = (fileEnding === '.txt');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue