Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ce4692a7b |
@@ -44,6 +44,9 @@ export function ConsentRequiredPrompt() {
|
|||||||
const [opened, setOpened] = useState(false);
|
const [opened, setOpened] = useState(false);
|
||||||
const [blockedCount, setBlockedCount] = useState(0);
|
const [blockedCount, setBlockedCount] = useState(0);
|
||||||
const snoozedUntil = useRef(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 blocked = useRef(new Map<MatrixEvent, Room>());
|
||||||
const modalStyle = useModalStyle(440);
|
const modalStyle = useModalStyle(440);
|
||||||
const server = mx.getDomain() ?? 'Your homeserver';
|
const server = mx.getDomain() ?? 'Your homeserver';
|
||||||
@@ -74,6 +77,8 @@ export function ConsentRequiredPrompt() {
|
|||||||
}, [consentUri]);
|
}, [consentUri]);
|
||||||
|
|
||||||
const retry = useCallback(() => {
|
const retry = useCallback(() => {
|
||||||
|
closingForRetry.current = true;
|
||||||
|
snoozedUntil.current = 0;
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
setOpened(false);
|
setOpened(false);
|
||||||
const pending = Array.from(blocked.current.entries());
|
const pending = Array.from(blocked.current.entries());
|
||||||
@@ -97,7 +102,13 @@ export function ConsentRequiredPrompt() {
|
|||||||
focusTrapOptions={{
|
focusTrapOptions={{
|
||||||
initialFocus: '#consent-review',
|
initialFocus: '#consent-review',
|
||||||
fallbackFocus: '#consent-later',
|
fallbackFocus: '#consent-later',
|
||||||
onDeactivate: later,
|
onDeactivate: () => {
|
||||||
|
if (closingForRetry.current) {
|
||||||
|
closingForRetry.current = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
later();
|
||||||
|
},
|
||||||
clickOutsideDeactivates: true,
|
clickOutsideDeactivates: true,
|
||||||
escapeDeactivates: true,
|
escapeDeactivates: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user