fixed rolemenu/tracks
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 154fe71..0c174f5 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -163,19 +163,20 @@
return [name, description];
};
+const defaultRoleMenuData = {
+ name: "Role Menu Page",
+ description: "A new role menu page",
+ min: 0,
+ max: 0,
+ options: []
+};
+
const editRoleMenuPage = async (
interaction: StringSelectMenuInteraction | ButtonInteraction,
m: Message,
data?: ObjectSchema
): Promise<ObjectSchema | null> => {
- if (!data)
- data = {
- name: "Role Menu Page",
- description: "A new role menu page",
- min: 0,
- max: 0,
- options: []
- };
+ if (!data) data = _.cloneDeep(defaultRoleMenuData)
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("back")
@@ -472,7 +473,7 @@
}
case "add": {
const newPage = await editRoleMenuPage(i, m);
- if (!newPage) break;
+ if (_.isEqual(newPage, defaultRoleMenuData)) break;
currentObject.push();
page = currentObject.length - 1;
break;