2024-08-14 22:43:42 +01:00

30 lines
1.0 KiB
JavaScript

/** Here is how this should work
*
* Currently SavedGuild is created and destroyed on demand, it's not viable to store settings here
* instead lets create a new database obj `GuildSettings` to store these, an automated job can erase
* a `GuildSettings` instance if no matching `SavedGuilds` are found within x number of days.
*
* The tables will not be linked directly, but will share a common `guild_id` field to find
* each other, or the saved guild will have a foreign key for the related `GuildSettings`.
*/
$(document).on("selectedServerChange", async function() {
server = getCurrentlyActiveServer();
updateColourInput("defaultEmbedColour", "#" + server.default_embed_colour);
});
$("#serverSettingsBtn").on("click", async function() {
await showServerSettingsModal();
});
async function showServerSettingsModal() {
const server = getCurrentlyActiveServer();
$("#serverSettingsModal").modal("show");
}
$("#serverSettingsForm").on("submit", function(e) {
e.preventDefault();
alert("not implemented");
})