mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Lint
This commit is contained in:
@@ -96,7 +96,7 @@ export function MainLinks() {
|
||||
</NavButton>
|
||||
<NavButton
|
||||
to="/onboarding/wifi-creds"
|
||||
icon={<WifiIcon value={1} disabled variant='navbar'/>}
|
||||
icon={<WifiIcon value={1} disabled variant="navbar" />}
|
||||
state={{ alonePage: true }}
|
||||
>
|
||||
{l10n.getString('navbar-connect_trackers')}
|
||||
|
||||
@@ -109,11 +109,10 @@ export function Button({
|
||||
state={state}
|
||||
onClick={(ev) => {
|
||||
if (disabled) {
|
||||
ev.preventDefault()
|
||||
ev.preventDefault();
|
||||
return;
|
||||
}
|
||||
if (props.onClick)
|
||||
return props.onClick(ev as any)
|
||||
if (props.onClick) return props.onClick(ev as any);
|
||||
}}
|
||||
>
|
||||
<ButtonContent icon={icon} loading={loading}>
|
||||
|
||||
@@ -23,8 +23,7 @@ export function WifiIcon({
|
||||
const y = useMemo(() => (1 - percent) * 13, [percent]);
|
||||
|
||||
const col = useMemo(() => {
|
||||
if (variant === 'navbar')
|
||||
return 'fill-inherit';
|
||||
if (variant === 'navbar') return 'fill-inherit';
|
||||
|
||||
const colorsMap: { [key: number]: string } = {
|
||||
0.4: 'fill-status-success',
|
||||
|
||||
@@ -20,7 +20,7 @@ export function HomeSettingsModal({
|
||||
>
|
||||
<div className="flex flex-col gap-4">
|
||||
<Typography variant="main-title" id="home-settings" />
|
||||
<HomeLayoutSettings />
|
||||
<HomeLayoutSettings variant="modal" />
|
||||
<div className="flex justify-end">
|
||||
<Button
|
||||
variant="tertiary"
|
||||
|
||||
@@ -35,7 +35,7 @@ import { ProgressBar } from '@/components/commons/ProgressBar';
|
||||
import { useBreakpoint } from '@/hooks/breakpoint';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { ProportionsResetModal } from './ProportionsResetModal';
|
||||
import * as Sentry from '@sentry/react'
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
const statusSteps = [
|
||||
// Order matters be carefull
|
||||
@@ -238,7 +238,7 @@ function UserHeightStatus({
|
||||
export function ScaledProportionsPage() {
|
||||
const [hmdHeight, setHmdHeight] = useState(0);
|
||||
const [tmpHeight, setTmpHeight] = useState(0);
|
||||
const [lastUsed, setLastUsed] = useState<'manual' | 'auto' | null>(null)
|
||||
const [lastUsed, setLastUsed] = useState<'manual' | 'auto' | null>(null);
|
||||
const { config, setConfig } = useConfig();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
|
||||
@@ -299,7 +299,7 @@ export function ScaledProportionsPage() {
|
||||
new SkeletonResetAllRequestT()
|
||||
);
|
||||
setConfig({ lastUsedProportions: 'scaled' });
|
||||
setLastUsed('manual')
|
||||
setLastUsed('manual');
|
||||
};
|
||||
|
||||
useRPCPacket(
|
||||
@@ -314,7 +314,7 @@ export function ScaledProportionsPage() {
|
||||
|
||||
if (res.status === UserHeightCalibrationStatus.DONE) {
|
||||
setConfig({ lastUsedProportions: 'scaled' });
|
||||
setLastUsed('auto')
|
||||
setLastUsed('auto');
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -335,7 +335,9 @@ export function ScaledProportionsPage() {
|
||||
return () => {
|
||||
cancel();
|
||||
if (lastUsed !== null) {
|
||||
Sentry.metrics.count('scaled_proportions', 1, { attributes: { calibration: lastUsed } })
|
||||
Sentry.metrics.count('scaled_proportions', 1, {
|
||||
attributes: { calibration: lastUsed },
|
||||
});
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
@@ -426,7 +428,7 @@ export function ScaledProportionsPage() {
|
||||
setTmpHeight(height);
|
||||
setResetModal('manual');
|
||||
} else {
|
||||
applyHeight(height)
|
||||
applyHeight(height);
|
||||
}
|
||||
setAuto(false);
|
||||
}}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { SkipSetupWarningModal } from '@/components/onboarding/SkipSetupWarningM
|
||||
import classNames from 'classnames';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import * as Sentry from '@sentry/react'
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
export function MountingChoose() {
|
||||
const { l10n } = useLocalization();
|
||||
@@ -68,7 +68,9 @@ export function MountingChoose() {
|
||||
to={'/onboarding/mounting/auto'}
|
||||
className="self-start mt-auto"
|
||||
onClick={() => {
|
||||
Sentry.metrics.count('mounting_choose', 1, { attributes: { choose: 'auto' } })
|
||||
Sentry.metrics.count('mounting_choose', 1, {
|
||||
attributes: { choose: 'auto' },
|
||||
});
|
||||
}}
|
||||
state={{ alonePage: state.alonePage }}
|
||||
>
|
||||
@@ -116,7 +118,9 @@ export function MountingChoose() {
|
||||
className="self-start mt-auto"
|
||||
state={{ alonePage: state.alonePage }}
|
||||
onClick={() => {
|
||||
Sentry.metrics.count('mounting_choose', 1, { attributes: { choose: 'manual' } })
|
||||
Sentry.metrics.count('mounting_choose', 1, {
|
||||
attributes: { choose: 'manual' },
|
||||
});
|
||||
}}
|
||||
>
|
||||
{l10n.getString(
|
||||
|
||||
@@ -16,7 +16,7 @@ import classNames from 'classnames';
|
||||
import { ReactNode, useEffect } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { TrackingChecklistStepId } from 'solarxr-protocol';
|
||||
import * as Sentry from '@sentry/react'
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
type StepsForm = { steps: Record<TrackingChecklistStepId, boolean> };
|
||||
export function TrackingChecklistSettings({
|
||||
@@ -55,12 +55,16 @@ export function TrackingChecklistSettings({
|
||||
// that prevent sending a packet for steps that didnt change
|
||||
if (!value && !ignoredSteps.includes(stepId)) {
|
||||
ignoreStep(stepId, true);
|
||||
Sentry.metrics.count('mute_checklist_step', 1, { attributes: { step: TrackingChecklistStepId[stepId] } })
|
||||
Sentry.metrics.count('mute_checklist_step', 1, {
|
||||
attributes: { step: TrackingChecklistStepId[stepId] },
|
||||
});
|
||||
}
|
||||
|
||||
if (value && ignoredSteps.includes(stepId)) {
|
||||
ignoreStep(stepId, false);
|
||||
Sentry.metrics.count('unmute_checklist_step', 1, { attributes: { step: TrackingChecklistStepId[stepId] } })
|
||||
Sentry.metrics.count('unmute_checklist_step', 1, {
|
||||
attributes: { step: TrackingChecklistStepId[stepId] },
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -133,13 +137,19 @@ export function LayoutSelector({
|
||||
);
|
||||
}
|
||||
|
||||
export function HomeLayoutSettings({ variant }: { variant: 'settings' | 'modal' }) {
|
||||
export function HomeLayoutSettings({
|
||||
variant,
|
||||
}: {
|
||||
variant: 'settings' | 'modal';
|
||||
}) {
|
||||
const { config, setConfig } = useConfig();
|
||||
|
||||
const setLayout = (layout: Config['homeLayout']) => {
|
||||
setConfig({ homeLayout: layout });
|
||||
Sentry.metrics.count('change_layout', 1, { attributes: { layout, from: variant } })
|
||||
}
|
||||
Sentry.metrics.count('change_layout', 1, {
|
||||
attributes: { layout, from: variant },
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
@@ -183,7 +193,7 @@ export function HomeScreenSettings() {
|
||||
<div className="flex flex-col gap-2">
|
||||
<SettingsPagePaneLayout icon={<HomeIcon />}>
|
||||
<Typography variant="main-title" id="home-settings" />
|
||||
<HomeLayoutSettings variant="settings"/>
|
||||
<HomeLayoutSettings variant="settings" />
|
||||
</SettingsPagePaneLayout>
|
||||
<SettingsPagePaneLayout icon={<CheckIcon size={18} />}>
|
||||
<Typography variant="main-title" id="tracking_checklist" />
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useWebsocketAPI } from './websocket-api';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { log } from '@/utils/logging';
|
||||
import { useConfig } from './config';
|
||||
import * as Sentry from '@sentry/react'
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
export enum ProcessStatus {
|
||||
PENDING,
|
||||
|
||||
@@ -7,4 +7,4 @@ export function hash(str: string) {
|
||||
|
||||
// Convert to unsigned 32-bit integer and normalize (0, 1)
|
||||
return (hash >>> 0) / 2 ** 32;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { BoardType, DeviceDataT } from 'solarxr-protocol';
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http';
|
||||
import { cacheWrap } from './cache';
|
||||
import semver from 'semver';
|
||||
import { hostname, locale, platform, version } from '@tauri-apps/plugin-os';
|
||||
import { hash } from './crypto';
|
||||
import { getUserID } from './user';
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ import {
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useConfig } from './config';
|
||||
import * as Sentry from '@sentry/react'
|
||||
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
type LabelBase = {
|
||||
value: number;
|
||||
@@ -195,7 +194,7 @@ export function useManualProportions({ type }: { type: 'linear' | 'ratio' }): {
|
||||
}
|
||||
sendRPCPacket(RpcMessage.SkeletonConfigRequest, new SkeletonConfigRequestT());
|
||||
setConfig({ lastUsedProportions: 'manual' });
|
||||
Sentry.metrics.count('manual_proportions_change', 1, { attributes: params })
|
||||
Sentry.metrics.count('manual_proportions_change', 1, { attributes: params });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useAtomValue } from 'jotai';
|
||||
import { assignedTrackersAtom, serverGuardsAtom } from '@/store/app-store';
|
||||
import { FEET_BODY_PARTS, FINGER_BODY_PARTS } from './body-parts';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import * as Sentry from '@sentry/react'
|
||||
import * as Sentry from '@sentry/react';
|
||||
|
||||
export type ResetBtnStatus = 'idle' | 'counting' | 'finished';
|
||||
|
||||
@@ -50,7 +50,6 @@ export function useReset(options: UseResetOptions, onReseted?: () => void) {
|
||||
Sentry.metrics.count('reset_click', 1, { attributes: options });
|
||||
};
|
||||
|
||||
|
||||
const onResetFinished = () => {
|
||||
setStatus('finished');
|
||||
if (onReseted) onReseted();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { locale, hostname, platform, version } from '@tauri-apps/plugin-os';
|
||||
import { locale, hostname, platform, version } from '@tauri-apps/plugin-os';
|
||||
import { hash } from './crypto';
|
||||
|
||||
export async function getUserID() {
|
||||
|
||||
@@ -64,8 +64,8 @@ export function getSentryOrCompute(enabled = false) {
|
||||
}
|
||||
|
||||
getUserID().then((id) => {
|
||||
Sentry.setUser({ id })
|
||||
})
|
||||
Sentry.setUser({ id });
|
||||
});
|
||||
|
||||
return newClient;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user