Add launcher shape setting

This commit is contained in:
rajchales-monito
2026-07-30 16:52:31 +02:00
parent 480a2b3395
commit 0f3c608d86
4 changed files with 61 additions and 17 deletions
+7 -1
View File
@@ -337,10 +337,11 @@ function defaultSettings() {
desktop: { side: "right", bottomPx: 22, sideOffsetPx: 22, widthPx: 370 },
mobile: { side: "right", bottomPx: 14, sideOffsetPx: 12, widthPx: 340 },
launcherEffects: {
shape: "bubble",
breathe: true,
ring: true,
hoverLabel: true,
avatar: true
avatar: false
},
notifications: {
pulseOnAdminReply: true,
@@ -2051,6 +2052,7 @@ function formatSite(site) {
const settings = parseJson(site.settings_json, defaultSettings());
settings.notifications = { ...defaultSettings().notifications, ...(settings.notifications || {}) };
settings.launcherEffects = { ...defaultSettings().launcherEffects, ...(settings.launcherEffects || {}) };
settings.launcherEffects.shape = normalizeLauncherShape(settings.launcherEffects.shape);
settings.widgetLanguage = normalizeWidgetLanguageSettings(settings.widgetLanguage);
settings.widgetCopy = normalizeWidgetCopy(settings.widgetCopy || {}, settings);
syncLegacyWidgetCopy(settings);
@@ -2077,6 +2079,10 @@ function formatSite(site) {
};
}
function normalizeLauncherShape(value) {
return ["circle", "bubble", "messenger", "whatsapp"].includes(value) ? value : "bubble";
}
function snippetFor(site) {
const settings = parseJson(site.settings_json, defaultSettings());
const languageSettings = normalizeWidgetLanguageSettings(settings.widgetLanguage);