diff --git a/www/drive/main.js b/www/drive/main.js index 10d98e400..b6cdfd2c9 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1415,6 +1415,12 @@ define([ }); $block.find('a.newdoc').click(function () { var type = $(this).attr('data-type') || 'pad'; + // We can't create a hash for files before uploading the file + if (type === 'file') { // TODO: remove when filename are gone? + sessionStorage[Cryptpad.newPadPathKey] = filesOp.isPathIn(currentPath, [TRASH]) ? '' : currentPath; + window.open('/' + type + '/'); + return; + } var name = Cryptpad.getDefaultName({type: type}); filesOp.addFile(currentPath, name, type, onCreated); });