Skip to content

Bug: ProfileSection timezone select is not saved or persisted #24

Description

@ChitkulLakshya

Bug: ProfileSection timezone select is not saved or persisted

Location

src/settings/ProfileSection.jsx:302-317

Description

The timezone <select> dropdown uses defaultValue="" but its value is never stored in state, never sent to the backend on save, and resets on page reload:

// Line 304 — no state binding, no onChange handler
<select className="settings-select" defaultValue="">
  <option value="" disabled>Select your timezone</option>
  ...
</select>

The handleSave function (line 137) only sends display_name:

body: JSON.stringify({ display_name: displayName }),

Impact

  • User selects a timezone, clicks "Save Changes" — timezone is silently dropped
  • On page reload, timezone resets to "Select your timezone" placeholder
  • Backend has no /api/user/profile timezone field

Fix

  1. Add timezone state: const [timezone, setTimezone] = useState('');
  2. Bind select: value={timezone} onChange={(e) => setTimezone(e.target.value)}
  3. Include in save payload: body: JSON.stringify({ display_name: displayName, timezone })
  4. Fetch timezone in fetchProfile(): if (data.timezone) setTimezone(data.timezone)
  5. Backend: Add timezone column to profiles table in Supabase, update PUT /api/user/profile to accept and store it

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions