leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

undo does not undo special events. #80

Closed cboulay closed 12 years ago

cboulay commented 12 years ago

Right now undo only deletes the event from the stack and possibly reverses possession. The server is smart enough to know that deleting a score should reduce the score-value, but the app is not smart enough for that.

From line 318 I need to add in checks for event types and change certain attributes of trackedgame depending on what's being undone. e.g., scores need the game's score decremented, substitutions need onfield and offfield rosters adjusted (without creating an event).

The score thing is simple, I'll fix it tomorrow.

The roster thing is more difficult because adjusting the roster will trigger creating and saving an event. I can adjust the roster with "silent:true" but then the views won't get updated. I guess I can do "silent: true" then also manually trigger a "sync" event, and have the views ALSO bind to the roster's sync.