Hi,
because you are on maternity leave as an employed, and you meet the employment requirement stated in the maternity law ("Barselsloven, §27, stk. 1, nr. 1"), your maternity benefits is not depending on A-kasse membership. In this case you will not be affected by the new rule.
The opposite will be applicable, if you are unemployed/not meet the employment requirement in Barselsloven §27 and go on maternity leave/apply for maternity benefits in your A-kasse after January 1, 2019. In this case your right to maternity benefits will be depending on that you are eligible for unemployment benefits (meeting the general requirments for being eligible for unemployment benefits). So in this case a person must fulfill the new residence requirement for being eligible for maternity benefits.
In the last case, a person must instead apply for the lower integration allowance (from January 2019 called "self-sufficiency and repatriation" benefit).
Best regards,
Anders Weber, www.a-kasser.dk