hekla icon indicating copy to clipboard operation
hekla copied to clipboard

Posting a comment crashes the app after a while

Open birkir opened this issue 7 years ago • 0 comments

Scenario: You post a comment. A placeholder comment is shown while the app makes a request to the API and waits for it to be resolved back with an ID.

When the real comment comes back from the API and is going to replace the placeholder comment, this happens:

[mobx-state-tree] Cannot modify 'late(function (){return v})[]@/items/17748940/comments', the object is protected and can only be modified by using an action.

I am guessing this isn't wrapped in an action (because of the ref.on()) and could be resolved by creating a separate action on the Item model.

https://github.com/birkir/hekla/blob/master/src/stores/models/Item.ts#L330

birkir avatar Aug 16 '18 04:08 birkir