Big things, maybe all's better now

This commit is contained in:
AlacrisDevs
2026-02-09 11:36:39 +02:00
parent 38a0c2274d
commit a4baa1ad25
46 changed files with 4906 additions and 427 deletions

View File

@@ -175,11 +175,11 @@
if (!file) return;
if (!file.type.startsWith("image/")) {
toasts.error("Please select an image file.");
toasts.error(m.toast_error_select_image());
return;
}
if (file.size > 2 * 1024 * 1024) {
toasts.error("Image must be under 2MB.");
toasts.error(m.toast_error_image_too_large());
return;
}
@@ -193,7 +193,7 @@
.upload(path, file, { upsert: true });
if (uploadError) {
toasts.error("Failed to upload avatar.");
toasts.error(m.toast_error_upload_avatar());
return;
}
@@ -209,15 +209,15 @@
.eq("id", org.id);
if (dbError) {
toasts.error("Failed to save avatar URL.");
toasts.error(m.toast_error_save_avatar_url());
return;
}
avatarUrl = publicUrl;
await invalidateAll();
toasts.success("Avatar updated.");
toasts.success(m.toast_success_avatar_updated());
} catch (err) {
toasts.error("Avatar upload failed.");
toasts.error(m.toast_error_avatar_upload());
} finally {
isUploading = false;
input.value = "";
@@ -232,11 +232,11 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to remove avatar.");
toasts.error(m.toast_error_remove_avatar());
} else {
avatarUrl = null;
await invalidateAll();
toasts.success("Avatar removed.");
toasts.success(m.toast_success_avatar_removed());
}
isSaving = false;
}
@@ -254,12 +254,12 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to save settings.");
toasts.error(m.toast_error_save_settings());
} else if (orgSlug !== org.slug) {
window.location.href = `/${orgSlug}/settings`;
} else {
await invalidateAll();
toasts.success("Settings saved.");
toasts.success(m.toast_success_settings_saved());
}
isSaving = false;
}
@@ -278,10 +278,10 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to save preferences.");
toasts.error(m.toast_error_save_preferences());
} else {
await invalidateAll();
toasts.success("Preferences saved.");
toasts.success(m.toast_success_preferences_saved());
}
isSavingPrefs = false;
}
@@ -299,10 +299,10 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to save event defaults.");
toasts.error(m.toast_error_save_event_defaults());
} else {
await invalidateAll();
toasts.success("Event defaults saved.");
toasts.success(m.toast_success_event_defaults_saved());
}
isSavingDefaults = false;
}
@@ -320,10 +320,10 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to save feature settings.");
toasts.error(m.toast_error_save_features());
} else {
await invalidateAll();
toasts.success("Feature settings saved.");
toasts.success(m.toast_success_features_saved());
}
isSavingFeatures = false;
}
@@ -348,10 +348,10 @@
.eq("id", org.id);
if (error) {
toasts.error("Failed to save social links.");
toasts.error(m.toast_error_save_social());
} else {
await invalidateAll();
toasts.success("Social links saved.");
toasts.success(m.toast_success_social_saved());
}
isSavingSocial = false;
}