Add launcher shape setting
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user