Updates To No Delete Safety

This commit is contained in:
thororen1234 2025-01-07 20:57:38 -05:00
parent 22316a9610
commit 870a9c940a

View file

@ -34,10 +34,9 @@ export default definePlugin({
settings,
async HandleGuildDeleteModal(server) {
if (settings.store.confirmModal) {
Alerts.show({ title: "Delete server?", body: <p>It's permanent, if that wasn't obvious.</p>, confirmColor: Button.Colors.RED, confirmText: "Delete", onConfirm: () => GetPropsAndDeleteGuild(server.id), cancelText: "Cancel" });
}
else {
GetPropsAndDeleteGuild(server.id);
return Alerts.show({ title: "Delete server?", body: <p>It's permanent, if that wasn't obvious.</p>, confirmColor: Button.Colors.RED, confirmText: "Delete", onConfirm: () => GetPropsAndDeleteGuild(server.id), cancelText: "Cancel" });
} else {
return GetPropsAndDeleteGuild(server.id);
}
},
patches: [
@ -45,7 +44,7 @@ export default definePlugin({
find: ".DELETE,onClick(){let",
replacement: {
match: /let \i=(\i).guild.toString\(\)/,
replace: "$self.HandleGuildDeleteModal($1);return;$&"
replace: "$self.HandleGuildDeleteModal($1);$&"
}
}
]