mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 17:11:13 -05:00
Fix: Resolve TypeScript errors in settings components
This commit is contained in:
@@ -94,7 +94,7 @@ export function AuthButtons() {
|
|||||||
<Trophy className="mr-2 h-4 w-4" />
|
<Trophy className="mr-2 h-4 w-4" />
|
||||||
<span>My Lists</span>
|
<span>My Lists</span>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem onClick={() => navigate('/profile#settings')}>
|
<DropdownMenuItem onClick={() => navigate('/settings')}>
|
||||||
<Settings className="mr-2 h-4 w-4" />
|
<Settings className="mr-2 h-4 w-4" />
|
||||||
<span>Settings</span>
|
<span>Settings</span>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ export function NotificationsTab() {
|
|||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.email_notifications) {
|
if (data.email_notifications) {
|
||||||
setEmailNotifications(data.email_notifications as EmailNotifications);
|
setEmailNotifications(data.email_notifications as unknown as EmailNotifications);
|
||||||
}
|
}
|
||||||
if (data.push_notifications) {
|
if (data.push_notifications) {
|
||||||
setPushNotifications(data.push_notifications as PushNotifications);
|
setPushNotifications(data.push_notifications as unknown as PushNotifications);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Initialize preferences if they don't exist
|
// Initialize preferences if they don't exist
|
||||||
@@ -84,8 +84,8 @@ export function NotificationsTab() {
|
|||||||
.from('user_preferences')
|
.from('user_preferences')
|
||||||
.insert([{
|
.insert([{
|
||||||
user_id: user.id,
|
user_id: user.id,
|
||||||
email_notifications: emailNotifications,
|
email_notifications: emailNotifications as any,
|
||||||
push_notifications: pushNotifications
|
push_notifications: pushNotifications as any
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function PrivacyTab() {
|
|||||||
|
|
||||||
const form = useForm<ProfilePrivacy & PrivacySettings>({
|
const form = useForm<ProfilePrivacy & PrivacySettings>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
privacy_level: profile?.privacy_level || 'public',
|
privacy_level: (profile?.privacy_level === 'friends' ? 'public' : profile?.privacy_level) || 'public',
|
||||||
show_pronouns: profile?.show_pronouns || false,
|
show_pronouns: profile?.show_pronouns || false,
|
||||||
activity_visibility: 'public',
|
activity_visibility: 'public',
|
||||||
search_visibility: true,
|
search_visibility: true,
|
||||||
@@ -98,7 +98,7 @@ export function PrivacyTab() {
|
|||||||
|
|
||||||
setPreferences(defaultSettings);
|
setPreferences(defaultSettings);
|
||||||
form.reset({
|
form.reset({
|
||||||
privacy_level: profile?.privacy_level || 'public',
|
privacy_level: (profile?.privacy_level === 'friends' ? 'public' : profile?.privacy_level) || 'public',
|
||||||
show_pronouns: profile?.show_pronouns || false,
|
show_pronouns: profile?.show_pronouns || false,
|
||||||
...defaultSettings
|
...defaultSettings
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user