You will be on the next round of layoffs regardless of your loyalty. "You were updating linkedin" is the excuse. It could be anything else. But the reality is that they found someone cheaper.
There's a reason that so many people now get prompted by moving "horizontally" between companies, very few companies today properly reward loyalty, if anything most actively incentivize individualism and disloyalty.
There is always "we fired 20% of the people, now their workload is on your shoulders or you will also be fired".
There is always "here is a book titled 'use agile to deliver twice as fast' now the deadline is in 3 months instead of 6 or else".
The only defense against that is having more options.
Wheels gotta move I guess, it's in their nature after all.