1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-04 14:30:28 +00:00

Reverse order of bags when creating new recipes

This commit is contained in:
Thomas E Tuoti 2024-12-21 18:42:58 -07:00
parent f82425a20d
commit ea1c31f651

View File

@ -295,7 +295,10 @@ SqlTiddlerStore.prototype.createRecipe = function(recipe_name,bag_names,descript
}
var self = this;
return this.sqlTiddlerDatabase.transaction(function() {
self.sqlTiddlerDatabase.createRecipe(recipe_name,bag_names,description);
// Reverse the array to maintain the original order in the database
// since SQLite will return them in reverse order
const reversedBagNames = bag_names.slice().reverse();
self.sqlTiddlerDatabase.createRecipe(recipe_name,reversedBagNames,description);
self.dispatchEvent("change");
return null;
});