From ea1c31f65185b14e0a9633849e5eeef23d3058d0 Mon Sep 17 00:00:00 2001 From: Thomas E Tuoti Date: Sat, 21 Dec 2024 18:42:58 -0700 Subject: [PATCH] Reverse order of bags when creating new recipes --- .../multiwikiserver/modules/store/sql-tiddler-store.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js index 1c1dc6442..7ced74865 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js @@ -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; });