krille-chan / fluffychat

The cutest instant messenger in the [matrix]
https://fluffychat.im/
GNU Affero General Public License v3.0
1.12k stars 198 forks source link

fix: never use root navigator for bottom sheets #956

Closed TheOneWithTheBraid closed 6 months ago

TheOneWithTheBraid commented 6 months ago

I realized for a while ago : If I login with a new session to FluffyChat, there always appears the friendly dialog asking me to perform SAS verification or SSSS unlock.

When on Linux, pressing the SAS button always failed. On mobile it worked. Looks like there was accidentally the root navigator used on desktops - and Matrix.of(context) (or whatever custom.of(context)) was unavailable in bottom sheets.

This PR fixes this bug by simply also not using the root navigator on desktops - as we already do on mobile. Disadvantage : If the showModalBottomSheet function is called from a sub-page on, it is only centered to that page. I guess that's definitely design wise a disadvantage but unless there's a better fix, I'd consider this as acceptable UI regression compared to have UI-wise beautiful sheets that sadly won't work.