Updated the template export to only show in development mode

This commit is contained in:
David Tittsworth 2018-08-13 10:42:07 -07:00
Родитель 032e11f859
Коммит d110e4568d
2 изменённых файлов: 19 добавлений и 16 удалений

Просмотреть файл

@ -99,21 +99,24 @@ export class MainStore extends BaseStore {
this.chartStore = new ChartStore(this);
this.registerExportTemplateTarget(
"Charticulator Template",
(template: Specification.Template.ChartTemplate) => {
return {
getProperties: () => [],
getFileExtension: () => "json",
generate: () => {
return new Promise<string>((resolve, reject) => {
const r = btoa(JSON.stringify(template, null, 2));
resolve(r);
});
}
};
}
);
if (process.env.NODE_ENV !== "development") {
// Only enable this if we are in the development environment
this.registerExportTemplateTarget(
"Charticulator Template",
(template: Specification.Template.ChartTemplate) => {
return {
getProperties: () => [],
getFileExtension: () => "json",
generate: () => {
return new Promise<string>((resolve, reject) => {
const r = btoa(JSON.stringify(template, null, 2));
resolve(r);
});
}
};
}
);
}
}
public saveState(): MainStoreState {

Просмотреть файл

@ -11,7 +11,7 @@ const plugins = [
buildTimestamp: new Date().getTime(),
}),
"process.env": {
"NODE_ENV": JSON.stringify(process.env.NODE_ENV)
"NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development")
}
})
];