the two year period must be used within a "reference period" of three years.
If you get a job now when you are in a period where you receive dagpenge, then you will continue to be within the 3-year period.
So, if you get fired before the 3-year period is over, then you will continue to receive dagpenge from where you left in the 2-year period, when you got the job.
It means that if you have received dagpenge for half a year, when you got the job, then you will still have 1,5 year left with dagpenge when you get fired from the job.
The new residence requirement will NOT apply in this case (for the current 2-year period). You have been approved for a 2-year period with dagpenge before January 1, 2019, and therefore you have the right to get dagpenge for the full 2-year period.
Only if you need later to apply for a new 2-year period, i.e if you have received dagpenge for 2 year, or if the 3-year period has expired, you will need to fulfill the income-requirement.