When the Prophet ﷺ was directed to face the Kaabah, the people asked, "Messenger of Allah, what about our brothers who died before this, those who passed away while they were praying toward Bayt al-Maqdis?"So Allah revealed, "And Allah would never let your faith go to waste" [Baqarah 2:143].
حدثنا وكيع حدثنا إسرائيل عن سماك بن حرب عن عكرمة
لما وجه النبي ﷺ إلى الكعبة قالوا يا رسول الله فكيف بمن مات من إخواننا قبل ذلك الذين ماتوا وهم يصلون إلى بيت المقدس فأنزل الله عز وجل {وما كان الله ليضيع إيمانكم}