diff --git a/apps/desktop/src/components/main/sidebar/profile/ota.tsx b/apps/desktop/src/components/main/sidebar/profile/ota.tsx
deleted file mode 100644
index 537c33658d..0000000000
--- a/apps/desktop/src/components/main/sidebar/profile/ota.tsx
+++ /dev/null
@@ -1,336 +0,0 @@
-import { Spinner } from "@hypr/ui/components/ui/spinner";
-
-import { relaunch } from "@tauri-apps/plugin-process";
-import { check, type Update } from "@tauri-apps/plugin-updater";
-import { createStore } from "@xstate/store";
-import { useSelector } from "@xstate/store/react";
-import { clsx } from "clsx";
-import { AlertCircle, CheckCircle, Download, RefreshCw, X } from "lucide-react";
-
-import { MenuItem } from "./shared";
-
-type State =
- | "idle"
- | "checking"
- | "error"
- | "noUpdate"
- | "available"
- | "downloading"
- | "ready"
- | "installing";
-
-interface Context {
- update: Update | null;
- error: string | null;
- downloadProgress: {
- downloaded: number;
- total: number | null;
- percentage: number;
- };
- state: State;
-}
-
-const updateStore = createStore({
- context: {
- update: null,
- error: null,
- downloadProgress: {
- downloaded: 0,
- total: null,
- percentage: 0,
- },
- state: "idle" as State,
- } as Context,
- on: {
- setState: (context, event: { state: State }) => ({
- ...context,
- state: event.state,
- }),
- checkSuccess: (context, event: { update: Update | null }) => ({
- ...context,
- update: event.update,
- error: null,
- state: event.update ? ("available" as State) : ("noUpdate" as State),
- }),
- checkError: (context, event: { error: string }) => ({
- ...context,
- error: event.error,
- update: null,
- state: "error" as State,
- }),
- startDownload: (context) => ({
- ...context,
- downloadProgress: {
- downloaded: 0,
- total: null,
- percentage: 0,
- },
- state: "downloading" as State,
- }),
- downloadProgress: (context, event: { chunkLength: number; contentLength?: number }) => ({
- ...context,
- downloadProgress: {
- downloaded: context.downloadProgress.downloaded + event.chunkLength,
- total: event.contentLength ?? context.downloadProgress.total,
- percentage: event.contentLength || context.downloadProgress.total
- ? Math.round(
- ((context.downloadProgress.downloaded + event.chunkLength)
- / (event.contentLength ?? context.downloadProgress.total ?? 1))
- * 100,
- )
- : 0,
- },
- }),
- downloadFinished: (context) => ({
- ...context,
- state: "ready" as State,
- }),
- cancelDownload: (context) => ({
- ...context,
- update: null,
- downloadProgress: {
- downloaded: 0,
- total: null,
- percentage: 0,
- },
- state: "idle" as State,
- }),
- setInstalling: (context) => ({
- ...context,
- state: "installing" as State,
- }),
- reset: (context) => ({
- ...context,
- update: null,
- error: null,
- downloadProgress: {
- downloaded: 0,
- total: null,
- percentage: 0,
- },
- state: "idle" as State,
- }),
- },
-});
-
-export const checkForUpdate = async () => {
- updateStore.trigger.setState({ state: "checking" });
-
- try {
- const update = await check();
- updateStore.trigger.checkSuccess({ update });
-
- if (!update) {
- setTimeout(() => {
- const currentState = updateStore.getSnapshot().context.state;
- if (currentState === "noUpdate") {
- updateStore.trigger.reset();
- }
- }, 2000);
- }
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : "Failed to check for updates";
- updateStore.trigger.checkError({ error: errorMessage });
- }
-};
-
-export function UpdateChecker() {
- const snapshot = useSelector(updateStore, (state) => state.context);
- const { state, update, error, downloadProgress } = snapshot;
-
- const handleCheckForUpdate = () => checkForUpdate();
-
- const handleStartDownload = async () => {
- if (!update) {
- return;
- }
-
- updateStore.trigger.startDownload();
-
- try {
- await update.download((event) => {
- if (event.event === "Started") {
- updateStore.trigger.downloadProgress({
- chunkLength: 0,
- contentLength: event.data.contentLength,
- });
- } else if (event.event === "Progress") {
- updateStore.trigger.downloadProgress({
- chunkLength: event.data.chunkLength,
- });
- } else if (event.event === "Finished") {
- updateStore.trigger.downloadFinished();
- }
- });
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : "Download failed";
- updateStore.trigger.checkError({ error: errorMessage });
- }
- };
-
- const handleCancelDownload = async () => {
- if (update) {
- try {
- await update.close();
- } catch (err) {
- console.error("Failed to close update:", err);
- }
- }
- updateStore.trigger.cancelDownload();
- };
-
- const handleInstall = async () => {
- if (!update) {
- return;
- }
-
- updateStore.trigger.setInstalling();
-
- try {
- if (process.env.NODE_ENV !== "development") {
- await update.install();
- await relaunch();
- }
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : "Installation failed";
- updateStore.trigger.checkError({ error: errorMessage });
- }
- };
-
- const handleRetry = () => {
- handleCheckForUpdate();
- };
-
- if (state === "checking") {
- return (
-
-
- Checking for updates...
-
- );
- }
-
- if (state === "noUpdate") {
- return (
-
-
- You're up to date
-
- );
- }
-
- if (state === "error") {
- return (
-