Skip to content

Commit 19106ed

Browse files
committed
feat: add disable update checks setting in the general settings
1 parent 763e640 commit 19106ed

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

apps/desktop/src-tauri/src/general_settings.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ pub struct GeneralSettingsStore {
9191
#[serde(default)]
9292
pub hide_dock_icon: bool,
9393
#[serde(default)]
94+
pub disable_update_checks: bool,
95+
#[serde(default)]
9496
pub auto_create_shareable_link: bool,
9597
#[serde(default = "default_true")]
9698
pub enable_notifications: bool,
@@ -188,6 +190,7 @@ impl Default for GeneralSettingsStore {
188190
instance_id: uuid::Uuid::new_v4(),
189191
upload_individual_files: false,
190192
hide_dock_icon: false,
193+
disable_update_checks: false,
191194
auto_create_shareable_link: false,
192195
enable_notifications: true,
193196
disable_auto_open_links: false,

apps/desktop/src/routes/(window-chrome)/settings/general.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ type ExtendedGeneralSettingsStore = GeneralSettingsStore;
6969
const createDefaultGeneralSettings = (): ExtendedGeneralSettingsStore => ({
7070
uploadIndividualFiles: false,
7171
hideDockIcon: false,
72+
disableUpdateChecks: false,
7273
autoCreateShareableLink: false,
7374
enableNotifications: true,
7475
enableNativeCameraPreview: false,
@@ -592,6 +593,14 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
592593
handleChange("serverUrl", origin);
593594
}}
594595
/>
596+
<SettingGroup title="Update Settings">
597+
<ToggleSettingItem
598+
label="Disable update checks"
599+
description="Disable automatic update checks."
600+
value={!!settings.disableUpdateChecks}
601+
onChange={(v) => handleChange("disableUpdateChecks", v)}
602+
/>
603+
</SettingGroup>
595604
</div>
596605
</div>
597606
);

apps/desktop/src/routes/(window-chrome)/update.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ import { getCurrentWindow, UserAttentionType } from "@tauri-apps/api/window";
44
import { relaunch } from "@tauri-apps/plugin-process";
55
import { check, type Update } from "@tauri-apps/plugin-updater";
66
import { createResource, createSignal, Match, Show, Switch } from "solid-js";
7+
import { generalSettingsStore } from "~/store";
78

89
export default function () {
910
const navigate = useNavigate();
1011
const [updateError, setUpdateError] = createSignal<string | null>(null);
1112

1213
const [update] = createResource(async () => {
1314
try {
15+
const settings = await generalSettingsStore.get();
16+
const isDisabled = settings?.disableUpdateChecks ?? false;
17+
18+
if(isDisabled) {
19+
setUpdateError("Update checks are currently disabled.");
20+
return;
21+
}
22+
1423
const update = await check();
1524
if (!update) return;
1625
return update;

apps/desktop/src/utils/tauri.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ videoImportProgress: "video-import-progress"
403403

404404
/** user-defined types **/
405405

406+
export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
406407
export type Annotation = { id: string; type: AnnotationType; x: number; y: number; width: number; height: number; strokeColor: string; strokeWidth: number; fillColor: string; opacity: number; rotation: number; text: string | null; maskType?: MaskType | null; maskLevel?: number | null }
407408
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
408409
export type AppTheme = "system" | "light" | "dark"
@@ -464,7 +465,7 @@ export type ExportSettings = ({ format: "Mp4" } & Mp4ExportSettings) | ({ format
464465
export type FileType = "recording" | "screenshot"
465466
export type Flags = { captions: boolean }
466467
export type FramesRendered = { renderedCount: number; totalFrames: number; type: "FramesRendered" }
467-
export type GeneralSettingsStore = { instanceId?: string; uploadIndividualFiles?: boolean; hideDockIcon?: boolean; autoCreateShareableLink?: boolean; enableNotifications?: boolean; disableAutoOpenLinks?: boolean; hasCompletedStartup?: boolean; theme?: AppTheme; commercialLicense?: CommercialLicense | null; lastVersion?: string | null; windowTransparency?: boolean; postStudioRecordingBehaviour?: PostStudioRecordingBehaviour; mainWindowRecordingStartBehaviour?: MainWindowRecordingStartBehaviour; custom_cursor_capture2?: boolean; serverUrl?: string; recordingCountdown?: number | null; enableNativeCameraPreview: boolean; autoZoomOnClicks?: boolean; postDeletionBehaviour?: PostDeletionBehaviour; excludedWindows?: WindowExclusion[]; deleteInstantRecordingsAfterUpload?: boolean; instantModeMaxResolution?: number; defaultProjectNameTemplate?: string | null; crashRecoveryRecording?: boolean; maxFps?: number; editorPreviewQuality?: EditorPreviewQuality; mainWindowPosition?: WindowPosition | null; cameraWindowPosition?: WindowPosition | null; cameraWindowPositionsByMonitorName?: { [key in string]: WindowPosition } }
468+
export type GeneralSettingsStore = { instanceId?: string; uploadIndividualFiles?: boolean; hideDockIcon?: boolean; disableUpdateChecks?: boolean; autoCreateShareableLink?: boolean; enableNotifications?: boolean; disableAutoOpenLinks?: boolean; hasCompletedStartup?: boolean; theme?: AppTheme; commercialLicense?: CommercialLicense | null; lastVersion?: string | null; windowTransparency?: boolean; postStudioRecordingBehaviour?: PostStudioRecordingBehaviour; mainWindowRecordingStartBehaviour?: MainWindowRecordingStartBehaviour; custom_cursor_capture2?: boolean; serverUrl?: string; recordingCountdown?: number | null; enableNativeCameraPreview: boolean; autoZoomOnClicks?: boolean; postDeletionBehaviour?: PostDeletionBehaviour; excludedWindows?: WindowExclusion[]; deleteInstantRecordingsAfterUpload?: boolean; instantModeMaxResolution?: number; defaultProjectNameTemplate?: string | null; crashRecoveryRecording?: boolean; maxFps?: number; editorPreviewQuality?: EditorPreviewQuality; mainWindowPosition?: WindowPosition | null; cameraWindowPosition?: WindowPosition | null; cameraWindowPositionsByMonitorName?: { [key in string]: WindowPosition } }
468469
export type GifExportSettings = { fps: number; resolution_base: XY<number>; quality: GifQuality | null }
469470
export type GifQuality = {
470471
/**
@@ -476,6 +477,7 @@ quality: number | null;
476477
*/
477478
fast: boolean | null }
478479
export type GlideDirection = "none" | "left" | "right" | "up" | "down"
480+
export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
479481
export type HapticPattern = "alignment" | "levelChange" | "generic"
480482
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
481483
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -489,7 +491,6 @@ export type JsonValue<T> = [T]
489491
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
490492
export type LogicalPosition = { x: number; y: number }
491493
export type LogicalSize = { width: number; height: number }
492-
export type MacOSVersionInfo = { major: number; minor: number; patch: number; displayName: string; buildNumber: string; isAppleSilicon: boolean }
493494
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
494495
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
495496
export type MaskKind = "sensitive" | "highlight"
@@ -533,6 +534,7 @@ export type RecordingStatus = "pending" | "recording"
533534
export type RecordingStopped = null
534535
export type RecordingTargetMode = "display" | "window" | "area" | "camera"
535536
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
537+
export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
536538
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
537539
export type RequestOpenSettings = { page: string }
538540
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -555,7 +557,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
555557
export type StereoMode = "stereo" | "monoL" | "monoR"
556558
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
557559
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
558-
export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean; metalSupported: boolean; gpuName: string | null }
560+
export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
559561
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
560562
export type TextSegment = { start: number; end: number; enabled?: boolean; content?: string; center?: XY<number>; size?: XY<number>; fontFamily?: string; fontSize?: number; fontWeight?: number; italic?: boolean; color?: string; fadeDuration?: number }
561563
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -574,6 +576,7 @@ export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: st
574576
export type WindowId = string
575577
export type WindowPosition = { x: number; y: number; displayId?: DisplayId | null }
576578
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
579+
export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
577580
export type XY<T> = { x: T; y: T }
578581
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
579582
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode; glideDirection?: GlideDirection; glideSpeed?: number; instantAnimation?: boolean; edgeSnapRatio?: number }

0 commit comments

Comments
 (0)