Merge pull request 'fix(consent): a retry that fails again reopens the terms prompt (#311)' (#406) from fix/consent-retry-snooze into lotus
CI / Build & Quality Checks (push) Canceled after 0s
CI / Trigger Desktop Build (push) Canceled after 0s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Docker image build & smoke test (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
CI / Build & Quality Checks (push) Canceled after 0s
CI / Trigger Desktop Build (push) Canceled after 0s
CI / Secret scan (gitleaks) (push) Canceled after 0s
CI / Docker image build & smoke test (push) Canceled after 0s
CI / Playwright smoke (e2e) (push) Canceled after 0s
This commit was merged in pull request #406.
This commit is contained in:
@@ -44,6 +44,9 @@ export function ConsentRequiredPrompt() {
|
||||
const [opened, setOpened] = useState(false);
|
||||
const [blockedCount, setBlockedCount] = useState(0);
|
||||
const snoozedUntil = useRef(0);
|
||||
// [Gitea #311] Closing via Retry also deactivates the focus trap; that must
|
||||
// not snooze, or a retry that fails again (terms not accepted yet) is silent.
|
||||
const closingForRetry = useRef(false);
|
||||
const blocked = useRef(new Map<MatrixEvent, Room>());
|
||||
const modalStyle = useModalStyle(440);
|
||||
const server = mx.getDomain() ?? 'Your homeserver';
|
||||
@@ -74,6 +77,8 @@ export function ConsentRequiredPrompt() {
|
||||
}, [consentUri]);
|
||||
|
||||
const retry = useCallback(() => {
|
||||
closingForRetry.current = true;
|
||||
snoozedUntil.current = 0;
|
||||
setOpen(false);
|
||||
setOpened(false);
|
||||
const pending = Array.from(blocked.current.entries());
|
||||
@@ -97,7 +102,13 @@ export function ConsentRequiredPrompt() {
|
||||
focusTrapOptions={{
|
||||
initialFocus: '#consent-review',
|
||||
fallbackFocus: '#consent-later',
|
||||
onDeactivate: later,
|
||||
onDeactivate: () => {
|
||||
if (closingForRetry.current) {
|
||||
closingForRetry.current = false;
|
||||
return;
|
||||
}
|
||||
later();
|
||||
},
|
||||
clickOutsideDeactivates: true,
|
||||
escapeDeactivates: true,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user