fix: move showActivity toggle from Account to Privacy settings panel
This commit is contained in:
@@ -11,7 +11,6 @@ import type { User, UserStatus, AvatarColor } from '@backspace/shared';
|
|||||||
import type { FederationOpResult } from '../../../utils/federationOps';
|
import type { FederationOpResult } from '../../../utils/federationOps';
|
||||||
import { isElectron } from '../../../platform/platform';
|
import { isElectron } from '../../../platform/platform';
|
||||||
import { Toggle } from '../../ui/Toggle';
|
import { Toggle } from '../../ui/Toggle';
|
||||||
import { useActivityStore } from '../../../stores/activityStore';
|
|
||||||
|
|
||||||
|
|
||||||
function AutoLaunchSettings() {
|
function AutoLaunchSettings() {
|
||||||
@@ -140,7 +139,6 @@ export function AccountPanel() {
|
|||||||
|
|
||||||
const instances = useInstanceStore((s) => s.instances);
|
const instances = useInstanceStore((s) => s.instances);
|
||||||
const changePassword = useAuthStore((s) => s.changePassword);
|
const changePassword = useAuthStore((s) => s.changePassword);
|
||||||
const showActivity = useActivityStore((s) => s.showActivity);
|
|
||||||
|
|
||||||
if (!user) return null;
|
if (!user) return null;
|
||||||
|
|
||||||
@@ -777,30 +775,6 @@ export function AccountPanel() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* ── Activity Status ── */}
|
|
||||||
<div>
|
|
||||||
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-1.5">Activity Status</div>
|
|
||||||
<div className="rounded-lg bg-white/[0.03] border border-white/[0.04] p-3.5">
|
|
||||||
<div className="flex items-center justify-between py-1">
|
|
||||||
<div>
|
|
||||||
<div className="text-[14px] text-txt-primary">Share Activity Status</div>
|
|
||||||
<div className="text-[12px] text-txt-tertiary mt-0.5">Allow others to see what you're up to</div>
|
|
||||||
</div>
|
|
||||||
<Toggle
|
|
||||||
enabled={showActivity}
|
|
||||||
onChange={async (enabled) => {
|
|
||||||
try {
|
|
||||||
await api.users.update({ showActivity: enabled });
|
|
||||||
useActivityStore.getState().setShowActivity(enabled);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Failed to update activity visibility:', err);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── Danger Zone ── */}
|
{/* ── Danger Zone ── */}
|
||||||
<div>
|
<div>
|
||||||
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-1.5">Danger Zone</div>
|
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-1.5">Danger Zone</div>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useAuthStore } from '../../../stores/authStore';
|
import { useAuthStore } from '../../../stores/authStore';
|
||||||
|
import { useActivityStore } from '../../../stores/activityStore';
|
||||||
import { api } from '../../../api/client';
|
import { api } from '../../../api/client';
|
||||||
import { Toggle } from '../../ui/Toggle';
|
import { Toggle } from '../../ui/Toggle';
|
||||||
|
|
||||||
export function PrivacyPanel() {
|
export function PrivacyPanel() {
|
||||||
const user = useAuthStore((s) => s.user);
|
const user = useAuthStore((s) => s.user);
|
||||||
const setUser = useAuthStore((s) => s.setUser);
|
const setUser = useAuthStore((s) => s.setUser);
|
||||||
|
const showActivity = useActivityStore((s) => s.showActivity);
|
||||||
const [discoverable, setDiscoverable] = useState(user?.discoverable !== false);
|
const [discoverable, setDiscoverable] = useState(user?.discoverable !== false);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
|
|
||||||
@@ -48,6 +50,34 @@ export function PrivacyPanel() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Activity Status */}
|
||||||
|
<div>
|
||||||
|
<div className="text-[11px] font-semibold text-txt-tertiary uppercase tracking-wider mb-1.5">
|
||||||
|
Activity Status
|
||||||
|
</div>
|
||||||
|
<div className="rounded-lg bg-white/[0.03] border border-white/[0.04] p-3.5">
|
||||||
|
<div className="flex items-center justify-between py-1">
|
||||||
|
<div className="flex-1 mr-4">
|
||||||
|
<div className="text-sm text-txt-primary">Share Activity Status</div>
|
||||||
|
<div className="text-xs text-txt-tertiary mt-0.5">
|
||||||
|
Allow others to see what you're up to, like games you're playing or music you're listening to.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Toggle
|
||||||
|
enabled={showActivity}
|
||||||
|
onChange={async (enabled) => {
|
||||||
|
try {
|
||||||
|
await api.users.update({ showActivity: enabled });
|
||||||
|
useActivityStore.getState().setShowActivity(enabled);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to update activity visibility:', err);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user