Run prettier on everything (#104)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
export function useIsMobile() {
|
||||
// Always return false to force desktop behavior
|
||||
return false;
|
||||
|
||||
@@ -31,7 +31,7 @@ export function useCountTokens() {
|
||||
setLoading(false);
|
||||
}
|
||||
},
|
||||
[setLoading, setError, setResult]
|
||||
[setLoading, setError, setResult],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -24,7 +24,7 @@ export function useLoadAppFile(appId: number | null, filePath: string | null) {
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Error loading file ${filePath} for app ${appId}:`,
|
||||
error
|
||||
error,
|
||||
);
|
||||
setError(error instanceof Error ? error : new Error(String(error)));
|
||||
setContent(null);
|
||||
@@ -50,7 +50,7 @@ export function useLoadAppFile(appId: number | null, filePath: string | null) {
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Error refreshing file ${filePath} for app ${appId}:`,
|
||||
error
|
||||
error,
|
||||
);
|
||||
setError(error instanceof Error ? error : new Error(String(error)));
|
||||
} finally {
|
||||
|
||||
@@ -21,7 +21,7 @@ export function useProposal(chatId?: number | undefined) {
|
||||
try {
|
||||
// Type assertion might be needed depending on how IpcClient is typed
|
||||
const result = (await IpcClient.getInstance().getProposal(
|
||||
chatId
|
||||
chatId,
|
||||
)) as ProposalResult | null;
|
||||
|
||||
if (result) {
|
||||
@@ -37,7 +37,7 @@ export function useProposal(chatId?: number | undefined) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
},
|
||||
[chatId] // Only depend on chatId, setProposalResult is stable
|
||||
[chatId], // Only depend on chatId, setProposalResult is stable
|
||||
); // Depend on chatId
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -52,7 +52,7 @@ export function useRunApp() {
|
||||
} catch (error) {
|
||||
console.error(`Error running app ${appId}:`, error);
|
||||
setPreviewErrorMessage(
|
||||
error instanceof Error ? error.message : error?.toString()
|
||||
error instanceof Error ? error.message : error?.toString(),
|
||||
);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -73,7 +73,7 @@ export function useRunApp() {
|
||||
} catch (error) {
|
||||
console.error(`Error stopping app ${appId}:`, error);
|
||||
setPreviewErrorMessage(
|
||||
error instanceof Error ? error.message : error?.toString()
|
||||
error instanceof Error ? error.message : error?.toString(),
|
||||
);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -97,7 +97,7 @@ export function useRunApp() {
|
||||
console.debug(
|
||||
"Restarting app",
|
||||
appId,
|
||||
removeNodeModules ? "with node_modules cleanup" : ""
|
||||
removeNodeModules ? "with node_modules cleanup" : "",
|
||||
);
|
||||
|
||||
// Clear the URL and add restart message
|
||||
@@ -127,25 +127,25 @@ export function useRunApp() {
|
||||
}
|
||||
// Check if the output contains a localhost URL
|
||||
const urlMatch = output.message.match(
|
||||
/(https?:\/\/localhost:\d+\/?)/
|
||||
/(https?:\/\/localhost:\d+\/?)/,
|
||||
);
|
||||
if (urlMatch) {
|
||||
setAppUrlObj({ appUrl: urlMatch[1], appId });
|
||||
}
|
||||
},
|
||||
removeNodeModules
|
||||
removeNodeModules,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(`Error restarting app ${appId}:`, error);
|
||||
setPreviewErrorMessage(
|
||||
error instanceof Error ? error.message : error?.toString()
|
||||
error instanceof Error ? error.message : error?.toString(),
|
||||
);
|
||||
} finally {
|
||||
setPreviewPanelKey((prevKey) => prevKey + 1);
|
||||
setLoading(false);
|
||||
}
|
||||
},
|
||||
[appId, setApp, setAppOutput, setAppUrlObj, setPreviewPanelKey]
|
||||
[appId, setApp, setAppOutput, setAppUrlObj, setPreviewPanelKey],
|
||||
);
|
||||
|
||||
const refreshAppIframe = useCallback(async () => {
|
||||
|
||||
@@ -119,7 +119,7 @@ function processSettingsForTelemetry(settings: UserSettings) {
|
||||
if (settings.telemetryConsent) {
|
||||
window.localStorage.setItem(
|
||||
TELEMETRY_CONSENT_KEY,
|
||||
settings.telemetryConsent
|
||||
settings.telemetryConsent,
|
||||
);
|
||||
} else {
|
||||
window.localStorage.removeItem(TELEMETRY_CONSENT_KEY);
|
||||
@@ -127,7 +127,7 @@ function processSettingsForTelemetry(settings: UserSettings) {
|
||||
if (settings.telemetryUserId) {
|
||||
window.localStorage.setItem(
|
||||
TELEMETRY_USER_ID_KEY,
|
||||
settings.telemetryUserId
|
||||
settings.telemetryUserId,
|
||||
);
|
||||
} else {
|
||||
window.localStorage.removeItem(TELEMETRY_USER_ID_KEY);
|
||||
|
||||
@@ -117,7 +117,7 @@ export function useStreamChat({
|
||||
setError(error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
},
|
||||
[setMessages, setIsStreaming, setIsPreviewOpen]
|
||||
[setMessages, setIsStreaming, setIsPreviewOpen],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -13,7 +13,7 @@ export function useSupabase() {
|
||||
const [loading, setLoading] = useAtom(supabaseLoadingAtom);
|
||||
const [error, setError] = useAtom(supabaseErrorAtom);
|
||||
const [selectedProject, setSelectedProject] = useAtom(
|
||||
selectedSupabaseProjectAtom
|
||||
selectedSupabaseProjectAtom,
|
||||
);
|
||||
|
||||
const ipcClient = IpcClient.getInstance();
|
||||
@@ -58,7 +58,7 @@ export function useSupabase() {
|
||||
setLoading(false);
|
||||
}
|
||||
},
|
||||
[ipcClient, setError, setLoading]
|
||||
[ipcClient, setError, setLoading],
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ export function useSupabase() {
|
||||
setLoading(false);
|
||||
}
|
||||
},
|
||||
[ipcClient, setError, setLoading]
|
||||
[ipcClient, setError, setLoading],
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -94,7 +94,7 @@ export function useSupabase() {
|
||||
(projectId: string | null) => {
|
||||
setSelectedProject(projectId);
|
||||
},
|
||||
[setSelectedProject]
|
||||
[setSelectedProject],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -71,7 +71,7 @@ export function useVersions(appId: number | null) {
|
||||
showError(error);
|
||||
}
|
||||
},
|
||||
[appId, setVersions, setError, selectedChatId, setMessages]
|
||||
[appId, setVersions, setError, selectedChatId, setMessages],
|
||||
);
|
||||
|
||||
return { versions, loading, error, refreshVersions, revertVersion };
|
||||
|
||||
Reference in New Issue
Block a user