hi all,
i believe i have encountered a race condition where values aren’t being set properly due to subsequent changes. my code is roughly this:
<$button>
Do The Thing
<$action-createtiddler $basetitle="new name" tags="mytag">
<$action-setfield $tiddler=<<createtiddler-title>> $field=thefield $value={{!!valueholder}}/>
</$action-createtiddler>
<$action-setfield valueholder=""/>
</$button>
ideally, what is supposed to happen is this:
- the new tiddler is created with a title and tag.
- the new tiddler’s
thefieldis set to the value in{{!!valueholder}}. - the current tiddler’s
valueholderis set to an empty string (blank).
what i think is actually happening is that step (1) is taking too long and so step (3) ends up happening before step (2).
the actual result is that the new tiddler’s thefield ends up blank.
this is replicable by pasting the above code into a new tiddler on tiddlywiki.com and setting that tiddler’s valueholder field to anything. after pressing the button, check the newly created tiddler new name's thefield field (or lack thereof).
does anyone have some insight on how i can fix this, making sure the tiddler creation is done before the valueholder field is wiped?
~scribs
