Skip to content

Commit ed5d598

Browse files
committed
Fix #2343: Enable Save button when timezone changes
- Added timezone field to frontend validation schema - Added timezone field to backend validation schema - Fixed state synchronization in Settings component
1 parent 5b86d89 commit ed5d598

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

client/src/Pages/Settings/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ const Settings = () => {
8585

8686
if (name === "timezone") {
8787
dispatch(setTimezone({ timezone: value }));
88+
// Make sure to update settingsData with the new timezone value
89+
setSettingsData(newSettingsData);
8890
}
8991

9092
if (name === "mode") {

client/src/Validation/validation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ const settingsValidation = joi.object({
277277
}),
278278
pagespeedApiKey: joi.string().allow("").optional(),
279279
language: joi.string().required(),
280+
timezone: joi.string().allow("").optional(),
280281
systemEmailHost: joi.string().allow(""),
281282
systemEmailPort: joi.number().allow(null, ""),
282283
systemEmailAddress: joi.string().allow(""),

server/validation/joi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ const updateAppSettingsBodyValidation = joi.object({
427427
checkTTL: joi.number().allow(""),
428428
pagespeedApiKey: joi.string().allow(""),
429429
language: joi.string().allow(""),
430+
timezone: joi.string().allow(""),
430431
// showURL: joi.bool().required(),
431432
systemEmailHost: joi.string().allow(""),
432433
systemEmailPort: joi.number().allow(""),

0 commit comments

Comments
 (0)