Closed skierpage closed 1 year ago
Hi @skierpage, savetiddlers was designed, in the first instance, to work with tw5, and tw5 does not have a backup mechanism. Thus savetiddlers can automatically create a backup (in the case of tw5 this is the default, but is disable by default for twc). There is a checkbox in the addon settings to enable backups for twc, and a box to set the backup directory. I would advise using this method of backups and disable the creation of backups from within your tiddlywikis.
Note that there is a new version as of yesterday that fixes another issue.
Thanks for the tip! Nevertheless the code is broken; it sets attribute "data-tiddlyfox-path" but never uses it.
I think for a while my mGSD (a TiddlyWiki variant with features) has not been creating backups in ~/Downloads/tiddlywikilocations/twbackup.
I stepped through it and think I see the problem.
saveBackup
callssaveFile
callsinjectedSaveFile
(from the extension) and then the event handlermessageBox.addEventListener("tiddlyfox-save-file", ...
handles the message. But the event handler, instead of getting the path from the"data-tiddlyfox-path"
message attribute, at line 92 in contentscript.js) setspath = currentlocation()
which gets it fromwindow.location
, and in the result in my case is it saves the file and the backup to the same file path.I think the fix is just to change that one line to
I'll attempt a pull request.