soiz1 commited on
Commit
3ebca36
·
verified ·
1 Parent(s): d2a9fac

Update src/lib/sb-file-uploader-hoc.jsx

Browse files
Files changed (1) hide show
  1. src/lib/sb-file-uploader-hoc.jsx +2 -2
src/lib/sb-file-uploader-hoc.jsx CHANGED
@@ -104,7 +104,7 @@ const SBFileUploaderHOC = function (WrappedComponent) {
104
  } else {
105
  // create <input> element and add it to DOM
106
  this.inputElement = document.createElement('input');
107
- this.inputElement.accept = '.sb,.sb2,.sb3,.pm,.pmp';
108
  this.inputElement.style = 'display: none;';
109
  this.inputElement.type = 'file';
110
  this.inputElement.onchange = this.handleChange; // connects to step 3
@@ -178,7 +178,7 @@ const SBFileUploaderHOC = function (WrappedComponent) {
178
  if (!fileInputFilename) return '';
179
  // only parse title with valid scratch project extensions
180
  // (.sb, .sb2, and .sb3)
181
- const matches = fileInputFilename.match(/^(.*)(\.sb[23]?|\.pm|\.pmp)$/);
182
  if (!matches) return '';
183
  return matches[1].substring(0, 100); // truncate project title to max 100 chars
184
  }
 
104
  } else {
105
  // create <input> element and add it to DOM
106
  this.inputElement = document.createElement('input');
107
+ this.inputElement.accept = '.sb,.sb2,.sb3,.pm,.pmp,.txt';
108
  this.inputElement.style = 'display: none;';
109
  this.inputElement.type = 'file';
110
  this.inputElement.onchange = this.handleChange; // connects to step 3
 
178
  if (!fileInputFilename) return '';
179
  // only parse title with valid scratch project extensions
180
  // (.sb, .sb2, and .sb3)
181
+ const matches = fileInputFilename.match(/^(.*)(\.sb[23]?|\.pm|\.pmp|\.txt)$/);
182
  if (!matches) return '';
183
  return matches[1].substring(0, 100); // truncate project title to max 100 chars
184
  }