Fix presence tracking and med reminder bugs
This commit is contained in:
@@ -396,14 +396,24 @@ export default function SettingsPage() {
|
||||
</button>
|
||||
</div>
|
||||
{notif.discord_enabled && (
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Your Discord user ID"
|
||||
value={notif.discord_user_id}
|
||||
onChange={(e) => setNotif({ ...notif, discord_user_id: e.target.value })}
|
||||
onBlur={() => updateNotif({ discord_user_id: notif.discord_user_id })}
|
||||
className="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700"
|
||||
/>
|
||||
<div className="space-y-1">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Your Discord user ID (numbers only)"
|
||||
value={notif.discord_user_id}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
if (val === '' || /^\d+$/.test(val)) {
|
||||
setNotif({ ...notif, discord_user_id: val });
|
||||
}
|
||||
}}
|
||||
onBlur={() => updateNotif({ discord_user_id: notif.discord_user_id })}
|
||||
className="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700"
|
||||
/>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
Enable Developer Mode in Discord, right-click your profile, and copy User ID
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -831,7 +841,7 @@ export default function SettingsPage() {
|
||||
/>
|
||||
<select
|
||||
value={newContact.contact_type}
|
||||
onChange={(e) => setNewContact({ ...newContact, contact_type: e.target.value })}
|
||||
onChange={(e) => setNewContact({ ...newContact, contact_type: e.target.value, contact_value: '' })}
|
||||
className="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100 bg-white dark:bg-gray-800"
|
||||
>
|
||||
<option value="discord">Discord</option>
|
||||
@@ -840,9 +850,18 @@ export default function SettingsPage() {
|
||||
</select>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={newContact.contact_type === 'discord' ? 'Discord User ID' : newContact.contact_type === 'email' ? 'Email address' : 'Phone number'}
|
||||
placeholder={newContact.contact_type === 'discord' ? 'Discord User ID (numbers only)' : newContact.contact_type === 'email' ? 'Email address' : 'Phone number'}
|
||||
value={newContact.contact_value}
|
||||
onChange={(e) => setNewContact({ ...newContact, contact_value: e.target.value })}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
if (newContact.contact_type === 'discord') {
|
||||
if (val === '' || /^\d+$/.test(val)) {
|
||||
setNewContact({ ...newContact, contact_value: val });
|
||||
}
|
||||
} else {
|
||||
setNewContact({ ...newContact, contact_value: val });
|
||||
}
|
||||
}}
|
||||
className="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100 bg-white dark:bg-gray-800"
|
||||
/>
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
Reference in New Issue
Block a user