Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(connect): require approval for new T3 Connect devices #36419

Mergedjuliusmarmingemerged 14 commits intomain fromrefs/pull/36419/headmerged by juliusmarminge View on GitHub

Showing 68 changed files with 17 additions and 1 deletion (loading 65).

x
0 of 68 viewed, 68 left
9 additions and 0 deletionsapps/mobile/src/components/ui/Dialog.android.test.tsxModified
View file
@@ -90,6 +90,15 @@
expect(current.container.textContent).toContain("Shared content imported");
});
​
+it("tells a replaced alert it was dismissed", () => {
+ mountHost();
+ const onDismiss = vi.fn();
+ act(() => Dialog.alert("Older", undefined, [{ text: "OK" }], { onDismiss }));
+ act(() => Dialog.alert("Newer", undefined, [{ text: "OK" }]));
+​
+ expect(onDismiss).toHaveBeenCalledOnce();
+});
+​
it("ignores a late action from a dialog that a newer one replaced", () => {
const { container } = mountHost();
const olderAction = vi.fn();
3 additions and 0 deletionsapps/mobile/src/components/ui/Dialog.android.tsxModified
View file
@@ -49,7 +49,10 @@
​
function submitRequest(dialog: DialogRequest) {
+ const replaced = presented;
setPresented({ ...dialog, id: ++nextPresentationId });
+ // A replaced alert closed without an answer, which its owner hears as a dismissal.
+ if (replaced?.kind === "alert") replaced.request.options?.onDismiss?.();
​