Open edvinasjurele opened 4 months ago
Hi @edvinasjurele thanks for opening this issue. I think I understand the issue, I tried to open the reproduction tho and it's broken (gives me an error) could you please add a working reproduction please?
Hi @alvarosabu, hm, the repro link works fine for me 🤔 but here is another repro: https://stackblitz.com/edit/stackblitz-starters-5wkmv5?file=index.js
Hi @edvinasjurele thanks for providing another reproduction, I dont know what happened but I also managed to run the first one, I like the runkit is really helpful.
Let me take care of it.
Expected Behavior
Storyblok client is possible to initialize with
resolveNestedRelations
disabled.Current Behavior
Initializing the Storyblok client with
resolveNestedRelations
flag disabled, does not correctly set the initial valueTemporary workaround
Manually set flag AFTER the storyblok client initialization.
Steps to Reproduce
https://runkit.com/embed/xx23fbgocz7c
Potential defect
When passing
resolveNestedRelations: false,
as part of init object, theresolveNestedRelations
should be set to false, but due tothis.resolveNestedRelations = config.resolveNestedRelations || true
in the https://github.com/storyblok/storyblok-js-client/blob/d04da2e201755a175aa6702db2cd485e145f5019/src/index.ts#L150 it is set to true for all falsey values including FALSE itself, as "false || true => true".We might replace
||
with??