mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-06 15:30:26 +00:00
Reverse order of bags when creating new recipes
This commit is contained in:
parent
f82425a20d
commit
ea1c31f651
@ -295,7 +295,10 @@ SqlTiddlerStore.prototype.createRecipe = function(recipe_name,bag_names,descript
|
|||||||
}
|
}
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.sqlTiddlerDatabase.transaction(function() {
|
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");
|
self.dispatchEvent("change");
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user