Hey all. Loving the new Attributes V2 drop - however I’m running into some apparent bugs, and am a bit lost on the API usage when compared to V1. I use the old API syntax ex—
window.fsAttributes = window.fsAttributes || ;
window.fsAttributes.push([
‘cmscombine’,
(listInstances) => {
console.log(‘Lists Combined Successfully!’);
},
]);
— a lot to add on top of Attributes. With the new V2 release, I have tried many times to perform the same thing using the new docs syntax, and cannot seem to get anything to fire.
My use case is simply trying to run code when List Nest finishes, but even the below syntax I get from the github docs seems to never fire:
window.FinsweetAttributes ||= ;
window.FinsweetAttributes.push([
‘list’,
(listInstances) => {
console.log(listInstances);
},
]);
Any insight or am I just misunderstanding the new syntax?
Hey @darrenharroff, we identified a small issue on our side. We’ve pushed a fix, you can now use the V2 callback as shown on the documentation
1 Like
Thank you @Support-Luis! Will test and confirm.
Still not working as presented in the docs. However in your DM, you noted the following syntax:
window.finsweetAttributes ||= ;
window.finsweetAttributes.push([
‘list’,
(result) => {
console.log(result);
},
]);
and this DOES work. So is the syntax issue in the docs simply that “Finsweet” should not be capitalized? “window.finsweetAttributes” instead of “window.FinsweetAttributes” as stated in the docs?
@darrenharroff, this could’ve been a cache issue on your end; the syntax I shared on the DM is no longer valid.
Can you please re-test with a cleared cache?
Interesting - seems like you’re right, the lower case is now not working. Docs syntax now functioning!
1 Like
hi both,
I’ve had a little script that would ‘click’ a display:none button to sort my list on load. however, the updated API doesn’t seem to be working for me. Am I missing something?
<script>
window.finsweetAttributes ||= [];
window.finsweetAttributes.push([
'list',
(listInstances) => {
document.getElementById('button').click();
},
]);
</script>
Many thanks!
Hey @tinwid!
You have a small typo on the window object!
This is the correct spelling
<script>
window.FinsweetAttributes = window.FinsweetAttributes || [];
window.FinsweetAttributes.push([
'list',
(listInstances) => {
document.getElementById('button').click();
},
]);
</script>
1 Like