Keep workspace editor target selection

This commit is contained in:
Mohamed Boudra
2026-05-19 21:30:43 +07:00
parent 84fb7e9e06
commit ad9b149bf7
5 changed files with 155 additions and 20 deletions
@@ -1,4 +1,4 @@
import { type ReactElement, useCallback, useEffect, useMemo } from "react";
import { type ReactElement, useCallback, useMemo } from "react";
import {
ActivityIndicator,
Pressable,
@@ -178,13 +178,6 @@ export function WorkspaceOpenInEditorButton({
);
const primaryOption = targets.find((target) => target.id === effectivePreferredEditorId) ?? null;
useEffect(() => {
if (!effectivePreferredEditorId || effectivePreferredEditorId === preferredEditorId) {
return;
}
void updatePreferredEditor(effectivePreferredEditorId).catch(() => undefined);
}, [effectivePreferredEditorId, preferredEditorId, updatePreferredEditor]);
const openMutation = useMutation({
mutationFn: (target: OpenTarget) => Promise.resolve(target.onOpen()),
onError: (error: unknown) => {