Option to disable telemetry

This commit is contained in:
Gregory Schier
2024-08-26 12:06:56 -07:00
parent c80ebdb156
commit f404aa53c6
23 changed files with 47 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
import type { Cookie } from '@yaakapp/api';
import { useCookieJars } from '../hooks/useCookieJars';
import { useUpdateCookieJar } from '../hooks/useUpdateCookieJar';
import type { Cookie } from '../lib/models/Cookie';
import { cookieDomain } from '../lib/models';
import { Banner } from './core/Banner';
import { IconButton } from './core/IconButton';

View File

@@ -77,6 +77,12 @@ export function SettingsGeneral() {
{ label: 'New Window', value: 'new' },
]}
/>
<Checkbox
checked={settings.telemetry}
title="Send Usage Statistics"
onChange={(telemetry) => updateSettings.mutate({ telemetry })}
/>
<Separator className="my-4" />
<Heading size={2}>

View File

@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
import type { CookieJar } from '../lib/models';
import type { CookieJar } from '@yaakapp/api';
import { invokeCmd } from '../lib/tauri';
import { useActiveWorkspace } from './useActiveWorkspace';

View File

@@ -1,6 +1,6 @@
import { useMutation } from '@tanstack/react-query';
import type { CookieJar } from '@yaakapp/api';
import { trackEvent } from '../lib/analytics';
import type { CookieJar } from '../lib/models';
import { invokeCmd } from '../lib/tauri';
import { useActiveWorkspace } from './useActiveWorkspace';
import { usePrompt } from './usePrompt';

View File

@@ -1,7 +1,7 @@
import { useMutation } from '@tanstack/react-query';
import type { CookieJar } from '@yaakapp/api';
import { InlineCode } from '../components/core/InlineCode';
import { trackEvent } from '../lib/analytics';
import type { CookieJar } from '../lib/models';
import { invokeCmd } from '../lib/tauri';
import { useConfirm } from './useConfirm';

View File

@@ -1,6 +1,6 @@
import type { Settings } from '@yaakapp/api';
import { useAtomValue } from 'jotai';
import { atom } from 'jotai/index';
import type { Settings } from '../lib/models/Settings';
import { getSettings } from '../lib/store';
const settings = await getSettings();

View File

@@ -1,5 +1,5 @@
import { useMutation } from '@tanstack/react-query';
import type { CookieJar } from '../lib/models';
import type { CookieJar } from '@yaakapp/api';
import { getCookieJar } from '../lib/store';
import { invokeCmd } from '../lib/tauri';

View File

@@ -1,5 +1,5 @@
import { useMutation } from '@tanstack/react-query';
import type { Settings } from '../lib/models';
import type { Settings } from '@yaakapp/api';
import { getSettings } from '../lib/store';
import { invokeCmd } from '../lib/tauri';

View File

@@ -1,9 +1,4 @@
import type { GrpcConnection, HttpResponse, HttpResponseHeader, Model } from '@yaakapp/api';
import type { Cookie } from './models/Cookie';
import type { CookieJar } from './models/CookieJar';
import type { Settings } from './models/Settings';
export type { CookieJar, Cookie, Settings };
import type { Cookie, GrpcConnection, HttpResponse, HttpResponseHeader, Model } from '@yaakapp/api';
export const BODY_TYPE_NONE = null;
export const BODY_TYPE_GRAPHQL = 'graphql';

View File

@@ -1,5 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CookieDomain } from "./CookieDomain";
import type { CookieExpires } from "./CookieExpires";
export type Cookie = { raw_cookie: string, domain: CookieDomain, expires: CookieExpires, path: [string, boolean], };

View File

@@ -1,3 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type CookieDomain = { "HostOnly": string } | { "Suffix": string } | "NotPresent" | "Empty";

View File

@@ -1,3 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type CookieExpires = { "AtUtc": string } | "SessionEnd";

View File

@@ -1,4 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Cookie } from "./Cookie";
export type CookieJar = { id: string, model: "cookie_jar", createdAt: string, updatedAt: string, workspaceId: string, name: string, cookies: Array<Cookie>, };

View File

@@ -1,3 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type Settings = { id: string, model: "settings", createdAt: string, updatedAt: string, theme: string, appearance: string, themeDark: string, themeLight: string, updateChannel: string, interfaceFontSize: number, interfaceScale: number, editorFontSize: number, editorSoftWrap: boolean, openWorkspaceNewWindow: boolean | null, };

View File

@@ -1,6 +1,12 @@
import type { Environment, Folder, GrpcRequest, HttpRequest, Workspace } from '@yaakapp/api';
import type { CookieJar } from './models/CookieJar';
import type { Settings } from './models/Settings';
import type {
CookieJar,
Environment,
Folder,
GrpcRequest,
HttpRequest,
Settings,
Workspace,
} from '@yaakapp/api';
import { invokeCmd } from './tauri';
export async function getSettings(): Promise<Settings> {