I need some help with some strange
# package-development
p
I need some help with some strange behavior with my context (See thread)
I have this context: https://github.com/patrickdemooij9/SeoToolkit.Umbraco/blob/dev/main/src/SeoToolkit.Umbraco.MetaFields/assets/src/workspaces/MetaFieldsContentContext.ts. For some reason the constructor of this context is called twice and I am not sure why. The manifest is located here: https://github.com/patrickdemooij9/SeoToolkit.Umbraco/blob/dev/main/src/SeoToolkit.Umbraco.MetaFields/assets/src/manifests/DocumentManifests.ts. And the thing that I notice is that it seems to be caused by my custom condition called "SeoToolkit.Enabled". If I remove the condition, then it only calls the constructor once. If I leave it, it calls it twice. The condition can be found here: https://github.com/patrickdemooij9/SeoToolkit.Umbraco/blob/dev/main/src/SeoToolkit.Umbraco.Common/assets/src/conditions/SeoEnabledCondition.ts
Very strange behavior that I don't quite understand, but it seems like something is wrong with the condition? Though the condition on its own actually does work
Seems like it was caused by calling the
args.onChange
even though that is what the documentation says to call: https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-types/condition