mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
ImportHandler: Pass ImportError
to import
hook
This commit is contained in:
parent
d1da8f1ebd
commit
4d457f6296
3 changed files with 16 additions and 2 deletions
|
@ -142,8 +142,8 @@ const doImport = async (req, res, padId) => {
|
|||
}
|
||||
|
||||
const destFile = path.join(tmpDirectory, `etherpad_import_${randNum}.${exportExtension}`);
|
||||
const importHandledByPlugin =
|
||||
(await hooks.aCallAll('import', {srcFile, destFile, fileEnding, padId})).some((x) => x);
|
||||
const context = {srcFile, destFile, fileEnding, padId, ImportError};
|
||||
const importHandledByPlugin = (await hooks.aCallAll('import', context)).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