mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-04 07:42:24 -08:00
Fix unverified counter (#1064)
<!-- Please read https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before submitting your pull request --> ### Description Fix Unverified counter for the account sessions. It also Fixes one visual error And lastly it disables the sliding sync by default maybe, it can be reverted on that but, even though the feature seems to be working very well, it is not something that someone would have a reason to care to use unless they are really pressed for resources and is otherwise not useful seeing the occasional extra bug <!-- Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change. --> Fixes #1052 #### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings ### AI disclosure: - [ ] Partially AI assisted (clarify which code was AI assisted and briefly explain what it does). - [ ] Fully AI generated (explain what all the generated code does in moderate detail). <!-- Write any explanation required here, but do not generate the explanation using AI!! You must prove you understand what the code in this PR does. --> Written w the assistance of some brined mozzarella
This commit is contained in:
4 files changed
+11
-14
No files matched your search
@@ -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
|
||||
@@ -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(
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user