Both sentences work for me. in ( A ), the sequence of events is more distinct and separated in time.. ( B ) seems to relate more to simultaneous events.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.