Glass blocks UV-B and UV-C, but not UV-A (unless you have a film). Many mushrooms can be enriched with UV-A, but UV-B is best. So yes, I agree, better to place outside in direct sun (or window open). But building the habit is the harder part for people tbh.
Glass doesn't block UV A so that might not be the case, don't know in particular which type of UV rays the mushrooms need to produce vitamin D however.