I have a button that functions to save the contents of a quick note and the value is stored in a status entry. If the status entry has no content, it displays notify as no note, if it has content, it displays note saved. After saving the note it empties the status entry above. But I’ve found that notify stays for a few seconds, so notify will show that the note is saved, and then it immediately changes to no note present. Because the status entry is immediately cleared, the content of the notify is immediately changed. But I don’t want to do that, because my note is indeed saved, I just need to clear the status entry to prepare for the next note.
Now my solution to deal with this is to make it two buttons so that there is no problem.
quick-note-button
<center>
<$button style="width: 40%;">
<%if [{$:/state/self/quick-note}length[]compare:number:lteq[0]] %>
<$action-sendmessage $message="tm-notify" $param="quick-note-notify" no-text="无笔记存在,不保存!!!"/>
<%else%>
<$action-createtiddler
$basetitle=<<unusedtitle baseName:"quick-note" separator:"-">>
tags="quick-note-file"
text={{{ [[$:/state/self/quick-note]get[text]] }}}
/>
<$action-sendmessage $message="tm-notify" $param="quick-note-notify" yes-text="笔记己保存!!!"/>
<%endif%>
Save
</$button>
<$button style="width: 40%;">
<$action-setfield $tiddler="$:/state/self/quick-note" text=""/>
Empty
</$button>
</center>
quick-note-notify
<%if [{$:/state/self/quick-note}length[]compare:number:lteq[0]] %>
<h1><<no-text>></h1>
<%else%>
<h1><<yes-text>></h1>
<%endif%>
So this could be a problem with notify. The solution I’ve come up with is to provide a countdown-like widget that clears the value of the status entry about three or five seconds after notify has finished displaying the content, so that maybe it won’t be a problem. But I don’t know enough about the underlying TiddlyWiki mechanics to be sure what that would bring.