1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Fix overeager alerts from core module overwrite upgrade warning

This fixes a bug in #3634, and refines the logic so that the warning is only given if the incoming tiddler exists as a shadow tiddler. (In my case I have several draft core modules inactive in my notes wiki and they were erroneously suppressed from the upgrade).
This commit is contained in:
Jeremy Ruston 2019-08-28 14:44:46 +01:00
parent 654eda02c6
commit 471b73158a

View File

@ -35,17 +35,17 @@ exports.upgrade = function(wiki,titles,tiddlers) {
}
for(var t=0; t<WARN_IMPORT_PREFIX_LIST.length; t++) {
var prefix = WARN_IMPORT_PREFIX_LIST[t];
if(title.substr(0,prefix.length) === prefix) {
if(title.substr(0,prefix.length) === prefix && wiki.isShadowTiddler(title)) {
showAlert = true;
messages[title] = $tw.language.getString("Import/Upgrader/System/Warning");
}
}
}
if(showAlert) {
var logger = new $tw.utils.Logger("import");
logger.alert($tw.language.getString("Import/Upgrader/System/Alert"));
}
});
if(showAlert) {
var logger = new $tw.utils.Logger("import");
logger.alert($tw.language.getString("Import/Upgrader/System/Alert"));
}
return messages;
};