Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix_unverified_maybe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix the account button showing you 0 sessions active and the verify this device showing when you have zero devices to verify
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export function UnverifiedNoticeBanner() {

const isUnverified = useIsUnverified();
const unverifiedDeviceCount = useUnverifiedDevices();
const hasUnverified =
isUnverified || (unverifiedDeviceCount !== undefined && unverifiedDeviceCount > 0);
const hasUnverified = (unverifiedDeviceCount ?? 0) > 0;
const [dismissCount, setDismissCount] = useState(unverifiedDeviceCount);

const [isDismissedNotice, setIsDismissedNotice] = useState(
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/room/RoomTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ export function RoomTimeline({
return (
<Box grow="Yes" style={{ position: 'relative' }}>
{unreadInfo?.readUptoEventId && !unreadInfo?.inLiveTimeline && isReady && (
<TimelineFloat position="Top">
<TimelineFloat position="Top" style={{ background: 'transparent' }}>
<Chip
variant="Primary"
radii="Pill"
Expand Down
15 changes: 4 additions & 11 deletions src/app/pages/client/sidebar/UserMenuTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,8 @@ export function useUnverifiedDevices() {
const crypto = mx.getCrypto();
const [devices] = useDeviceList();

const [, otherDevices] = useSplitCurrentDevice(devices);

const otherDevicesId = useDeviceIds(otherDevices);
const unverifiedDeviceCount = useUnverifiedDeviceCount(
crypto,
mx.getSafeUserId(),
otherDevicesId
);
const devicesId = useDeviceIds(devices);
const unverifiedDeviceCount = useUnverifiedDeviceCount(crypto, mx.getSafeUserId(), devicesId);
return unverifiedDeviceCount;
}

Expand All @@ -616,8 +610,7 @@ export function UnverifiedMenuOption() {
const unverifiedDeviceCount = useUnverifiedDevices();
const unverified = useIsUnverified();

const hasUnverified =
unverified || (unverifiedDeviceCount !== undefined && unverifiedDeviceCount > 0);
const hasUnverified = (unverifiedDeviceCount ?? 0) > 0;

return (
<>
Expand Down Expand Up @@ -659,7 +652,7 @@ export function UserMenuTab({ isBottom, isMobile }: { isBottom?: boolean; isMobi

const unverifiedDeviceCount = useUnverifiedDevices();
const unverified = useIsUnverified();
const hasUnverified = unverified || (unverifiedDeviceCount ?? 0) > 0;
const hasUnverified = (unverifiedDeviceCount ?? 0) > 0;

const displayName = profile.displayName ?? getMxIdLocalPart(userId) ?? userId;
const avatarUrl = profile.avatarUrl
Expand Down
Loading