Save only the final extracted strokes

This commit is contained in:
Shaunak Kishore
2015-09-11 01:22:55 -04:00
parent 02e57a2007
commit 4166d0924f
2 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ var bindings = {
Session.set('glyph.selected_point', undefined); Session.set('glyph.selected_point', undefined);
var glyph = Session.get('glyph.data'); var glyph = Session.get('glyph.data');
glyph.manual.verified = false; glyph.manual.verified = false;
Session.set('glyph.data', glyph); change_glyph('save_glyph', glyph);
} else { } else {
var glyph = Session.get('glyph.data'); var glyph = Session.get('glyph.data');
delete glyph.manual; delete glyph.manual;
@ -98,7 +98,6 @@ var bindings = {
return; return;
} }
glyph.manual.verified = !glyph.manual.verified; glyph.manual.verified = !glyph.manual.verified;
Session.set('glyph.data', glyph);
change_glyph('save_glyph', glyph); change_glyph('save_glyph', glyph);
}, },
'd': function() { 'd': function() {

View File

@ -1,6 +1,9 @@
function save_glyph(glyph) { function save_glyph(glyph) {
check(glyph.name, String); check(glyph.name, String);
Glyphs.upsert({name: glyph.name}, glyph); var saved_glyph = _.extend({}, glyph);
saved_glyph.strokes = saved_glyph.render.strokes;
delete saved_glyph.render;
Glyphs.upsert({name: glyph.name}, saved_glyph);
return glyph; return glyph;
} }