Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion react-common/components/share/ShareInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
<Textarea
ariaDescribedBy="share-description-title"
ariaLabel={lf("Type a description for your project")}
initialValue={description || projectDescription || ''}
initialValue={description !== undefined ? description : (projectDescription || '')}
onChange={setDescription}
id="projectDescriptionTextareaShare"
maxLength={pxt.MAX_DESCRIPTION_LENGTH}
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4456,7 +4456,7 @@ export class ProjectView

async publishAsync (name: string, description?: string,screenshotUri?: string, forceAnonymous?: boolean): Promise<pxt.editor.ShareData> {
pxt.tickEvent("menu.embed.publish", undefined, { interactiveConsent: true });
if ((name && this.state.projectName != name) || description) {
if ((name && this.state.projectName != name) || description !== undefined) {
await this.updateHeaderNameAsync(name, description);
}

Expand Down Expand Up @@ -4606,18 +4606,18 @@ export class ProjectView

updateHeaderNameAsync(name: string, description?: string): Promise<void> {
// nothing to do?
if (pkg.mainPkg.config.name == name && (!description || pkg.mainPkg.config.description == description))
if (pkg.mainPkg.config.name == name && (description === undefined || pkg.mainPkg.config.description == description))
return Promise.resolve();

//Save the name in the target MainPackage as well
pkg.mainPkg.config.name = name;
pkg.mainPkg.config.description = description || pkg.mainPkg.config.description;
pkg.mainPkg.config.description = description !== undefined ? description : pkg.mainPkg.config.description;

pxt.debug('saving project name to ' + name);
let f = pkg.mainEditorPkg().lookupFile("this/" + pxt.CONFIG_NAME);
let config = JSON.parse(f.content) as pxt.PackageConfig;
config.name = name;
config.description = description || config.description;
config.description = description !== undefined ? description : config.description;
return f.setContentAsync(pxt.Package.stringifyConfig(config))
.then(() => {
if (this.state.header)
Expand Down
Loading