Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): avoid freezing appearance font settings #5642

Closedalex73630(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5642/headopened View on GitHub

Showing 3 changed files with 118 additions and 32 deletions.

x
0 of 3 viewed, 3 left
47 additions and 32 deletionsapps/web/src/components/settings/FontFamilyPicker.tsxModified
View file
@@ -1,7 +1,11 @@
import { LegendList, type LegendListRef } from "@legendapp/list/react";
import { CheckIcon, ChevronDownIcon, SearchIcon } from "lucide-react";
import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
-import { isMonospaceFamily, queryInstalledFontFamilies } from "../../appearanceFonts";
+import {
+ filterFontFamiliesWithoutBlocking,
+ isMonospaceFamily,
+ queryInstalledFontFamilies,
+} from "../../appearanceFonts";
import {
Combobox,
ComboboxEmpty,
@@ -58,44 +62,27 @@
});
​
-let grantedProbeStarted = false;
-​
-/**
- * Discover eagerly when the permission is already granted, so the picker
- * renders without waiting for a focus. Electron's default permission handler
- * approves silently (it has no prompt UI), and a browser that granted once
- * reports "granted" on later visits — in both, no user gesture is needed.
- * "prompt" and "denied" states change nothing: the focus-driven flow stays,
- * because raising the browser prompt still requires a gesture.
- */
-function probeAlreadyGrantedPermission(): void {
- if (grantedProbeStarted || enumerationState.status !== "unknown") return;
- grantedProbeStarted = true;