[TIMOB-14978] Fixed bug with order of events when checking if need to force a rebuild. Added check if encryptJS flag changes.