#1022 Fix for long names for state diagrams

This commit is contained in:
Knut Sveidqvist
2019-10-23 19:22:36 +02:00
parent c87637c6f4
commit 4a1eb55127
4 changed files with 49 additions and 4 deletions

View File

@@ -64,7 +64,14 @@ export const addState = function(id, type, doc, descr, note) {
currentDocument.states[id].type = type;
}
}
if (descr) addDescription(id, descr.trim());
if (descr) {
if (typeof descr === 'string') addDescription(id, descr.trim());
if (typeof descr === 'object') {
descr.forEach(des => addDescription(id, des.trim()));
}
}
if (note) currentDocument.states[id].note = note;
};