mirror of
https://github.com/xodio/xod.git
synced 2026-03-13 12:16:54 +01:00
tweak(xod-client): reset metadata when creating new project
This commit is contained in:
@@ -94,19 +94,16 @@ export default (state = {}, action) => {
|
||||
// Project
|
||||
//
|
||||
case AT.PROJECT_CREATE: {
|
||||
const oldLocalPatchesPaths = R.compose(
|
||||
R.map(XP.getPatchPath),
|
||||
XP.listLocalPatches
|
||||
const libraryPatches = R.compose(
|
||||
R.filter(XP.isGenuinePatch),
|
||||
XP.listLibraryPatches
|
||||
)(state);
|
||||
|
||||
const mainPatch = XP.createPatch();
|
||||
const mainPatch = XP.setPatchPath(MAIN_PATCH_PATH, XP.createPatch());
|
||||
|
||||
return R.compose(
|
||||
explodeEither,
|
||||
XP.assocPatch(MAIN_PATCH_PATH, mainPatch),
|
||||
XP.setProjectName(''),
|
||||
XP.omitPatches(oldLocalPatchesPaths)
|
||||
)(state);
|
||||
const newProject = XP.createProject();
|
||||
|
||||
return XP.mergePatchesList([mainPatch, ...libraryPatches], newProject);
|
||||
}
|
||||
|
||||
case AT.PROJECT_IMPORT: {
|
||||
|
||||
@@ -58,6 +58,7 @@ export {
|
||||
getArityStepFromPatch,
|
||||
isVariadicPatch,
|
||||
isAbstractPatch,
|
||||
isGenuinePatch,
|
||||
isPatchNotImplementedInXod,
|
||||
doesPatchHaveGenericPins,
|
||||
validateAbstractPatch,
|
||||
|
||||
Reference in New Issue
Block a user