Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.sb3 --> .ubp #90

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/containers/sb3-downloader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import log from '../lib/log';
const getProjectTitleFromFilename = fileInputFilename => {
if (!fileInputFilename) return '';
// only parse title with valid scratch project extensions
// (.sb, .sb2, and .sb3)
const matches = fileInputFilename.match(/^(.*)\.sb[23]?$/);
// (.sb, .sb2, .sb3 and .ubp)
const matches = fileInputFilename.match(/^\.ubp|(.*)\.sb[23]?$/);
if (!matches) return '';
return matches[1].substring(0, 100); // truncate project title to max 100 chars
};
Expand Down Expand Up @@ -100,9 +100,9 @@ class SB3Downloader extends React.Component {
suggestedName: this.props.projectFilename,
types: [
{
description: 'Scratch 3 Project',
description: 'Unsandboxed Project',
accept: {
'application/x.scratch.sb3': '.sb3'
'application/x.unsandboxed.ubp': '.ubp'
}
}
],
Expand Down Expand Up @@ -271,7 +271,7 @@ const getProjectFilename = (curTitle, defaultTitle) => {
if (!filenameTitle || filenameTitle.length === 0) {
filenameTitle = defaultTitle;
}
return `${filenameTitle.substring(0, 100)}.sb3`;
return `${filenameTitle.substring(0, 100)}.ubp`;
};

SB3Downloader.propTypes = {
Expand Down