mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
feat: Minor 3.1.0 (#150)
* Some features are now optional (#148) * fix(dev): yarn.lock tree fix * feat: bookmarks moved to optional permissions * fix: analytics not working in firefox * feat!: ability to turn off analytics (uses permissions on firefox) * feat: analytics tracker for bookmark export * feat: add privacy policy link in about section * docs: privacy policy update * feat: ability to chain multiple dialogs * fix(loc): analytics option translation * feat: settings review dialog * fix: background script fails to load because of frontend code * chore: use analytics permission as storage value * fix: inverted analytics value * feat!: option to disable thumbnail capture * fix(ci): sed typo * fix: minor fixes * fix(firefox): web-ext lint error fix * chore(ci): switch web-ext action * chore(lint): fix eslint warnings * chore(deps): monthly dependency bump (September 2025) (#149) * chore: 3.1.0 version bump * chore: minor cleanup * fix: allow analytics checkbox stays inactive after denying permission on firefox * fix(deps): yarn.lock rebuild * fix: type assertion for userId * fix: settings review dialog not showing if welcome dialog is not required * fix: analytics and thumbnail capture toggles react incorrectly if permission is denied
This commit is contained in:
@@ -2,6 +2,7 @@ import useSettings, { SettingsValue } from "@/hooks/useSettings";
|
||||
import { Button, Checkbox, Dropdown, Field, Option, OptionOnSelectData } from "@fluentui/react-components";
|
||||
import { KeyCommand20Regular } from "@fluentui/react-icons";
|
||||
import { useOptionsStyles } from "../hooks/useOptionsStyles";
|
||||
import { analyticsPermission } from "@/features/analytics";
|
||||
|
||||
export default function GeneralSection(): React.ReactElement
|
||||
{
|
||||
@@ -14,8 +15,23 @@ export default function GeneralSection(): React.ReactElement
|
||||
const [listLocation, setListLocation] = useSettings("listLocation");
|
||||
const [contextAction, setContextAction] = useSettings("contextAction");
|
||||
|
||||
const [allowAnalytics, setAllowAnalytics] = useState<boolean | null>(null);
|
||||
|
||||
const cls = useOptionsStyles();
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
analyticsPermission.getValue().then(setAllowAnalytics);
|
||||
return analyticsPermission.watch(setAllowAnalytics);
|
||||
}, []);
|
||||
|
||||
const updateAnalytics = (enabled: boolean): void =>
|
||||
{
|
||||
setAllowAnalytics(null);
|
||||
analyticsPermission.setValue(enabled)
|
||||
.catch(() => setAllowAnalytics(!enabled));
|
||||
};
|
||||
|
||||
const openShortcutsPage = (): Promise<any> =>
|
||||
browser.tabs.create({
|
||||
url: "chrome://extensions/shortcuts",
|
||||
@@ -60,6 +76,12 @@ export default function GeneralSection(): React.ReactElement
|
||||
label={ i18n.t("options_page.general.options.unload_tabs") }
|
||||
checked={ dismissOnLoad ?? false }
|
||||
onChange={ (_, e) => setDismissOnLoad(e.checked as boolean) } />
|
||||
|
||||
<Checkbox
|
||||
label={ i18n.t("options_page.general.options.allow_analytics") }
|
||||
checked={ allowAnalytics ?? true }
|
||||
disabled={ allowAnalytics === null }
|
||||
onChange={ (_, e) => updateAnalytics(e.checked as boolean) } />
|
||||
</section>
|
||||
|
||||
<Field label={ i18n.t("options_page.general.options.list_locations.title") }>
|
||||
|
||||
Reference in New Issue
Block a user