mlemgroup / mlem

Mlem for Lemmy
https://lemmy.ml/c/mlemapp
GNU General Public License v3.0
176 stars 32 forks source link

Removing Uploaded Photo Cancels/Clears Post #1013

Open d42ohpaz opened 5 months ago

d42ohpaz commented 5 months ago

Describe the bug I was writing a post, and I had uploaded a photo. I decided to change the photo I had uploaded, so I clicked the x on the photo. The popup dismissed, and the login screen popup was displayed saying my session expired. I cancelled the login popup, and the new post popup was redisplayed, but now empty. I lost my entire post.

Expected Behavior I expected to remove the photo, but keep editing my post without data loss.

Actual Behavior The popup dismissed, and the login screen popup was displayed saying my session expired. I cancelled the login popup, and the new post popup was redisplayed, but now empty.

To Reproduce Upload a photo. Remove the photo.

Mlem Information: Version 1.2, Build 847 from TestFlight.

Additional Context Not sure if it matters, but I was trying to post to a community I am not a member of on a different server than I am logged into.

Sjmarf commented 5 months ago

Thanks for the bug report! We're sorry to hear that this happened.

This probably happens due to the way our current .sheet system is implemented, in which both the token renewal sheet and post composer sheet are attached at the same level. As two sheets can't display at once at the same level, one closes when the other opens. To solve this, we could have an AppRoute equivalent for sheets, and attach a .sheet(item: Binding<SheetRoute>) object to every sheet view. This would allow sheets to stack properly, and would resolve the FaceID issue too. This is something I'll try to implement in 2.0.