Update information on product page when variant / option changes

I would like to show a delivery time for a product (with variants) based on a metafield.

I have used this code so far:

{% if current_variant.metafields.global.lieferung == true %}>
Sehr hohe Nachfrage | Aktuelle Lieferzeit: 2-3 Wochen> {% else %}>
Sofort lieferbar> {% endif %}

However once a user changes the information the function is not being executed and thus all variants have the same information. Once I reload the page the correct information is being shown for the variation.

Does anyone have a solution for that?

Best,

Dave