mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 14:22:51 +00:00
passing lint
This commit is contained in:
@@ -34,4 +34,7 @@ avd-mirror-remote ssh_target:
|
||||
scrcpy
|
||||
|
||||
adb-logs:
|
||||
while ! adb logcat --pid=$(adb shell pidof -s dev.fressh.app); do sleep 1; done
|
||||
while ! adb logcat --pid=$(adb shell pidof -s dev.fressh.app); do sleep 1; done
|
||||
|
||||
ios-logs:
|
||||
pnpm dlx react-native log-ios
|
||||
@@ -17,7 +17,7 @@ import { useSshConnMutation } from '@/lib/query-fns';
|
||||
import {
|
||||
connectionDetailsSchema,
|
||||
secretsManager,
|
||||
type ConnectionDetails,
|
||||
type InputConnectionDetails,
|
||||
} from '@/lib/secrets-manager';
|
||||
import { useTheme, type AppTheme } from '@/lib/theme';
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function TabsIndex() {
|
||||
return <Host />;
|
||||
}
|
||||
|
||||
const defaultValues: ConnectionDetails = {
|
||||
const defaultValues: InputConnectionDetails = {
|
||||
host: 'test.rebex.net',
|
||||
port: 22,
|
||||
username: 'demo',
|
||||
@@ -265,7 +265,7 @@ function KeyIdPickerField() {
|
||||
}
|
||||
|
||||
function PreviousConnectionsSection(props: {
|
||||
onSelect: (connection: ConnectionDetails) => void;
|
||||
onSelect: (connection: InputConnectionDetails) => void;
|
||||
}) {
|
||||
const theme = useTheme();
|
||||
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
||||
@@ -297,7 +297,7 @@ function PreviousConnectionsSection(props: {
|
||||
|
||||
function ConnectionRow(props: {
|
||||
id: string;
|
||||
onSelect: (connection: ConnectionDetails) => void;
|
||||
onSelect: (connection: InputConnectionDetails) => void;
|
||||
}) {
|
||||
const theme = useTheme();
|
||||
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
||||
|
||||
@@ -63,6 +63,7 @@ function ShellDetail() {
|
||||
<SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.background }}>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
headerBackVisible: true,
|
||||
headerLeft: () => (
|
||||
<Pressable
|
||||
onPress={() => router.back()}
|
||||
|
||||
@@ -39,8 +39,6 @@ export default function TabsShellList() {
|
||||
function ShellContent() {
|
||||
const connectionsQuery = useQuery(listSshShellsQueryOptions);
|
||||
|
||||
console.log('DEBUG connectionsQuery.data', !!connectionsQuery.data);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<Stack.Screen
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
type QueryClient,
|
||||
} from '@tanstack/react-query';
|
||||
import { useRouter } from 'expo-router';
|
||||
import { secretsManager, type ConnectionDetails } from './secrets-manager';
|
||||
import { secretsManager, type InputConnectionDetails } from './secrets-manager';
|
||||
import { AbortSignalTimeout } from './utils';
|
||||
|
||||
export const useSshConnMutation = () => {
|
||||
@@ -18,7 +18,7 @@ export const useSshConnMutation = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (connectionDetails: ConnectionDetails) => {
|
||||
mutationFn: async (connectionDetails: InputConnectionDetails) => {
|
||||
try {
|
||||
console.log('Connecting to SSH server...');
|
||||
const sshConnection = await RnRussh.connect({
|
||||
@@ -28,9 +28,9 @@ export const useSshConnMutation = () => {
|
||||
security:
|
||||
connectionDetails.security.type === 'password'
|
||||
? {
|
||||
type: 'password',
|
||||
password: connectionDetails.security.password,
|
||||
}
|
||||
type: 'password',
|
||||
password: connectionDetails.security.password,
|
||||
}
|
||||
: { type: 'key', privateKey: 'TODO' },
|
||||
onStatusChange: (status) => {
|
||||
console.log('SSH connection status', status);
|
||||
|
||||
@@ -82,9 +82,9 @@ function makeBetterSecureStore<
|
||||
const unsafedRootManifest = rawRootManifestString
|
||||
? JSON.parse(rawRootManifestString)
|
||||
: {
|
||||
manifestVersion: rootManifestVersion,
|
||||
manifestChunksIds: [],
|
||||
};
|
||||
manifestVersion: rootManifestVersion,
|
||||
manifestChunksIds: [],
|
||||
};
|
||||
const rootManifest = rootManifestSchema.parse(unsafedRootManifest);
|
||||
const manifestChunks = await Promise.all(
|
||||
rootManifest.manifestChunksIds.map(async (manifestChunkId) => {
|
||||
@@ -395,11 +395,11 @@ const betterConnectionStorage = makeBetterSecureStore({
|
||||
parseValue: (value) => connectionDetailsSchema.parse(JSON.parse(value)),
|
||||
});
|
||||
|
||||
export type ConnectionDetails = z.infer<typeof connectionDetailsSchema>;
|
||||
export type InputConnectionDetails = z.infer<typeof connectionDetailsSchema>;
|
||||
|
||||
async function upsertConnection(params: {
|
||||
id: string;
|
||||
details: ConnectionDetails;
|
||||
details: InputConnectionDetails;
|
||||
priority: number;
|
||||
}) {
|
||||
await betterConnectionStorage.upsertEntry({
|
||||
|
||||
Reference in New Issue
Block a user