https://demo-hub.tiddlyhost.com/#%24%3A%2Farsheth%2Fcard-ui%2Fbuttons%2Ffocus-card
\procedure focus-card()
<% if [$:/HistoryList]get[current-tiddler]!match<currentTiddler>] %>
<$action-setfield $tiddler="$:/HistoryList" current-tiddler=<<storyTiddler>>/>
<$action-navigate $to=<<storyTiddler>>/>
<% elseif [$:/HistoryList]get[current-tiddler]match<currentTiddler>] %>
<$action-deletefield $tiddler="$:/HistoryList" $field="current-tiddler"/>
<% else %>
<$action-deletefield $tiddler="$:/HistoryList" $field="current-tiddler" />
<% endif %>
\end
<$button actions=<<focus-card>> class=<<tv-config-toolbar-class>>>
{{$:/images/remix-icon/design/focus-3-line}}</$button>
Here I am trying to create a viewtoolbar button to set the storyTiddler
as the field-value of the current-tiddler
field of $:/HistoryList
tiddler (as part of one of my custom UI). On the second click I want to remove the current-tiddler
field from $:/HistoryList
tiddler so as to change the currrentTiddler
The first step is working, but the second one is not. Can someone help.