textileio / photos

[DEPRECATED] Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos
https://www.textile.photos/
MIT License
241 stars 22 forks source link

Fixes image remove actionsheet #1305

Closed andrewxhill closed 5 years ago

andrewxhill commented 5 years ago

there is a bug where the actionsheet was missing the 'remove' button and 'cancel' would actually lead to the image being removed.

this was due to,

  1. action sheet being shown before the state was updated, so it was missing the data about which photo was selected.
  2. because no photo selected, it would not be removable, so no remove option
  3. then the state would update, changing the index of where cancel should be and remove should be in the button list
  4. but since the actionsheet isn't an updatable view, there would still only be a 'cancel' button, at index 0 where 'remove' should be now that the state is update.

anyway... this fixes it by just showing the action sheet after the state is updated