Even though Rey is a big role, everyone influences everyone.
After several more hours of this torture, Leia was brought back to her cell where she was thrown onto the floor and fell unconscious.
During the flight, Solo asks Leia about the information in R2-D2's memory.