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
|
scrcpy
|
||||||
|
|
||||||
adb-logs:
|
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 {
|
import {
|
||||||
connectionDetailsSchema,
|
connectionDetailsSchema,
|
||||||
secretsManager,
|
secretsManager,
|
||||||
type ConnectionDetails,
|
type InputConnectionDetails,
|
||||||
} from '@/lib/secrets-manager';
|
} from '@/lib/secrets-manager';
|
||||||
import { useTheme, type AppTheme } from '@/lib/theme';
|
import { useTheme, type AppTheme } from '@/lib/theme';
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export default function TabsIndex() {
|
|||||||
return <Host />;
|
return <Host />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultValues: ConnectionDetails = {
|
const defaultValues: InputConnectionDetails = {
|
||||||
host: 'test.rebex.net',
|
host: 'test.rebex.net',
|
||||||
port: 22,
|
port: 22,
|
||||||
username: 'demo',
|
username: 'demo',
|
||||||
@@ -265,7 +265,7 @@ function KeyIdPickerField() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function PreviousConnectionsSection(props: {
|
function PreviousConnectionsSection(props: {
|
||||||
onSelect: (connection: ConnectionDetails) => void;
|
onSelect: (connection: InputConnectionDetails) => void;
|
||||||
}) {
|
}) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
||||||
@@ -297,7 +297,7 @@ function PreviousConnectionsSection(props: {
|
|||||||
|
|
||||||
function ConnectionRow(props: {
|
function ConnectionRow(props: {
|
||||||
id: string;
|
id: string;
|
||||||
onSelect: (connection: ConnectionDetails) => void;
|
onSelect: (connection: InputConnectionDetails) => void;
|
||||||
}) {
|
}) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
const styles = React.useMemo(() => makeStyles(theme), [theme]);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ function ShellDetail() {
|
|||||||
<SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.background }}>
|
<SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.background }}>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
|
headerBackVisible: true,
|
||||||
headerLeft: () => (
|
headerLeft: () => (
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => router.back()}
|
onPress={() => router.back()}
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ export default function TabsShellList() {
|
|||||||
function ShellContent() {
|
function ShellContent() {
|
||||||
const connectionsQuery = useQuery(listSshShellsQueryOptions);
|
const connectionsQuery = useQuery(listSshShellsQueryOptions);
|
||||||
|
|
||||||
console.log('DEBUG connectionsQuery.data', !!connectionsQuery.data);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
type QueryClient,
|
type QueryClient,
|
||||||
} from '@tanstack/react-query';
|
} from '@tanstack/react-query';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import { secretsManager, type ConnectionDetails } from './secrets-manager';
|
import { secretsManager, type InputConnectionDetails } from './secrets-manager';
|
||||||
import { AbortSignalTimeout } from './utils';
|
import { AbortSignalTimeout } from './utils';
|
||||||
|
|
||||||
export const useSshConnMutation = () => {
|
export const useSshConnMutation = () => {
|
||||||
@@ -18,7 +18,7 @@ export const useSshConnMutation = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async (connectionDetails: ConnectionDetails) => {
|
mutationFn: async (connectionDetails: InputConnectionDetails) => {
|
||||||
try {
|
try {
|
||||||
console.log('Connecting to SSH server...');
|
console.log('Connecting to SSH server...');
|
||||||
const sshConnection = await RnRussh.connect({
|
const sshConnection = await RnRussh.connect({
|
||||||
@@ -28,9 +28,9 @@ export const useSshConnMutation = () => {
|
|||||||
security:
|
security:
|
||||||
connectionDetails.security.type === 'password'
|
connectionDetails.security.type === 'password'
|
||||||
? {
|
? {
|
||||||
type: 'password',
|
type: 'password',
|
||||||
password: connectionDetails.security.password,
|
password: connectionDetails.security.password,
|
||||||
}
|
}
|
||||||
: { type: 'key', privateKey: 'TODO' },
|
: { type: 'key', privateKey: 'TODO' },
|
||||||
onStatusChange: (status) => {
|
onStatusChange: (status) => {
|
||||||
console.log('SSH connection status', status);
|
console.log('SSH connection status', status);
|
||||||
|
|||||||
@@ -82,9 +82,9 @@ function makeBetterSecureStore<
|
|||||||
const unsafedRootManifest = rawRootManifestString
|
const unsafedRootManifest = rawRootManifestString
|
||||||
? JSON.parse(rawRootManifestString)
|
? JSON.parse(rawRootManifestString)
|
||||||
: {
|
: {
|
||||||
manifestVersion: rootManifestVersion,
|
manifestVersion: rootManifestVersion,
|
||||||
manifestChunksIds: [],
|
manifestChunksIds: [],
|
||||||
};
|
};
|
||||||
const rootManifest = rootManifestSchema.parse(unsafedRootManifest);
|
const rootManifest = rootManifestSchema.parse(unsafedRootManifest);
|
||||||
const manifestChunks = await Promise.all(
|
const manifestChunks = await Promise.all(
|
||||||
rootManifest.manifestChunksIds.map(async (manifestChunkId) => {
|
rootManifest.manifestChunksIds.map(async (manifestChunkId) => {
|
||||||
@@ -395,11 +395,11 @@ const betterConnectionStorage = makeBetterSecureStore({
|
|||||||
parseValue: (value) => connectionDetailsSchema.parse(JSON.parse(value)),
|
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: {
|
async function upsertConnection(params: {
|
||||||
id: string;
|
id: string;
|
||||||
details: ConnectionDetails;
|
details: InputConnectionDetails;
|
||||||
priority: number;
|
priority: number;
|
||||||
}) {
|
}) {
|
||||||
await betterConnectionStorage.upsertEntry({
|
await betterConnectionStorage.upsertEntry({
|
||||||
|
|||||||
Reference in New Issue
Block a user