diff --git a/apps/landing/src/components/DocsSidebar.tsx b/apps/landing/src/components/DocsSidebar.tsx index 2b88f0d2e..5f140f9a9 100644 --- a/apps/landing/src/components/DocsSidebar.tsx +++ b/apps/landing/src/components/DocsSidebar.tsx @@ -10,7 +10,7 @@ interface Props { } export default function DocsSidebar(props: Props) { - const activeSection = props.activePath?.split('/')[0] || props.navigation[0].slug; + const activeSection = props.activePath?.split('/')[0] || props.navigation[0]?.slug; const activeSectionData = props.navigation.find((section) => section.slug === activeSection); @@ -27,7 +27,7 @@ export default function DocsSidebar(props: Props) { const Icon = config.sections.find((s) => s.slug === section.slug)?.icon; return ( { const url = parsePath(path); if (!url) return null; - const { render, metadata } = parseMarkdown(config.docs[path]); + const { render, metadata } = parseMarkdown(config.docs[path]!); parsedDocs[url] = { - title: metadata?.name ?? toTitleCase(url.split('/')[2]), - slug: url.split('/')[2], + title: metadata?.name ?? toTitleCase(url.split('/')[2]!), + slug: url.split('/')[2]!, url, - categoryName: toTitleCase(url.split('/')[1]), + categoryName: toTitleCase(url.split('/')[1]!), sortByIndex: metadata?.index ?? DEFAULT_INDEX, html: render }; @@ -77,15 +77,15 @@ export function getDocsNavigation(config: DocsConfig, docs?: Record delete clonedDoc.html; const category = url.split('/')[1], - title = toTitleCase(category), + title = toTitleCase(category!), existingCategory = categories.findIndex((i) => i.slug === category); if (existingCategory != -1) { - categories[existingCategory].category.push(clonedDoc); + categories[existingCategory]?.category.push(clonedDoc); } else { categories.push({ title, - slug: category, + slug: category!, index: DEFAULT_INDEX, category: [clonedDoc] }); @@ -98,7 +98,7 @@ export function getDocsNavigation(config: DocsConfig, docs?: Record return cat; }) // sort categories smallest first doc's index - .sort((a, b) => a.category[0].sortByIndex - b.category[0].sortByIndex); + .sort((a, b) => a.category[0]!.sortByIndex - b.category[0]!.sortByIndex); navigation.push({ title: section.title, @@ -134,8 +134,8 @@ export function getDoc(url: string, config: DocsConfig): SingleDocResponse { } function parsePath(path: string): string | null { - const url = path.split('docs/')[1].split('.md')[0]; - if (!url.includes('/')) return null; + const url = path.split('docs/')[1]!.split('.md')[0]; + if (!url?.includes('/')) return null; return url; } @@ -153,7 +153,7 @@ type DocUrls = { url: string; title: string }[]; export function getNextDoc( navigation: DocsNavigation, docUrl: string -): { url: string; title: string } { +): { url: string; title: string } | undefined { const docUrls: DocUrls = []; // flatten the navigation for (const section of navigation) { diff --git a/apps/landing/src/pages/docs/doc.page.server.ts b/apps/landing/src/pages/docs/doc.page.server.ts index 5a1b245a4..fd0e7a592 100644 --- a/apps/landing/src/pages/docs/doc.page.server.ts +++ b/apps/landing/src/pages/docs/doc.page.server.ts @@ -7,7 +7,7 @@ export const passToClient = ['pageProps']; export async function onBeforeRender(pageContext: PageContextBuiltIn) { return { pageContext: { - pageProps: getDoc(pageContext.routeParams['*'], config) + pageProps: getDoc(pageContext.routeParams['*']!, config) } }; } diff --git a/apps/landing/src/pages/team.page.tsx b/apps/landing/src/pages/team.page.tsx index 1e7dccbb8..4553fba10 100644 --- a/apps/landing/src/pages/team.page.tsx +++ b/apps/landing/src/pages/team.page.tsx @@ -11,7 +11,7 @@ const teamMembers: Array = [ { name: 'Jamie Pine', role: 'Founder, Engineer & Designer', - image: teamImages['jamie.jpg'], + image: teamImages['jamie.jpg']!, socials: { twitter: 'https://twitter.com/jamiepine', twitch: 'https://twitch.tv/jamiepinelive', @@ -21,7 +21,7 @@ const teamMembers: Array = [ { name: 'Brendan Allan', role: 'Rust Engineer', - image: teamImages['brendan.jpg'], + image: teamImages['brendan.jpg']!, socials: { twitter: 'https://twitter.com/brendonovichdev', twitch: 'https://twitch.tv/brendonovich', @@ -31,7 +31,7 @@ const teamMembers: Array = [ { name: 'Oscar Beaumont', role: 'Rust Engineer', - image: teamImages['oscar.jpg'], + image: teamImages['oscar.jpg']!, socials: { twitter: 'https://twitter.com/oscartbeaumont', twitch: 'https://twitch.tv/oscartbeaumont', @@ -41,16 +41,16 @@ const teamMembers: Array = [ { name: 'Ericson Soares', role: 'Rust Engineer', - image: teamImages['ericson.jpg'], + image: teamImages['ericson.jpg']!, socials: { twitter: 'https://twitter.com/fogodev', github: 'https://github.com/fogodev' } }, { - name: 'Utku Bakir', + name: 'Utku Bakır', role: 'React Native Engineer', - image: teamImages['utku.jpg'], + image: teamImages['utku.jpg']!, socials: { github: 'https://github.com/utkubakir' } @@ -58,7 +58,7 @@ const teamMembers: Array = [ { name: 'Haden Fletcher', role: 'Engineer & Designer', - image: teamImages['haden.jpg'], + image: teamImages['haden.jpg']!, socials: { twitter: 'https://twitter.com/heymaxichrome', twitch: 'https://twitch.tv/maxichrome', @@ -68,7 +68,7 @@ const teamMembers: Array = [ { name: 'Jake Robinson', role: 'Rust Engineer', - image: teamImages['jake.jpg'], + image: teamImages['jake.jpg']!, socials: { github: 'https://github.com/brxken128' } @@ -76,7 +76,7 @@ const teamMembers: Array = [ { name: 'Mihail Dounaev', role: 'Graphic Designer', - image: teamImages['mihail.jpg'], + image: teamImages['mihail.jpg']!, socials: { twitter: 'https://twitter.com/mmmintdesign', dribbble: 'https://dribbble.com/mmmint' @@ -89,109 +89,109 @@ const investors: Array = [ name: 'Joseph Jacks', role: 'Founder, OSSC', investmentRound: 'Lead Seed', - image: investorImages['josephjacks.jpg'] + image: investorImages['josephjacks.jpg']! }, { name: 'Guillermo Rauch', role: 'CEO, Vercel', investmentRound: 'Co-Lead Seed', - image: investorImages['guillermo.jpg'] + image: investorImages['guillermo.jpg']! }, { name: 'Naval Ravikant', role: 'Founder, AngelList', investmentRound: 'Co-Lead Seed', - image: investorImages['naval.jpg'] + image: investorImages['naval.jpg']! }, { name: 'Neha Narkhede', role: 'Confluent, Apache Kafka', investmentRound: 'Seed', - image: investorImages['neha.jpg'] + image: investorImages['neha.jpg']! }, { name: 'Austen Allred', role: 'CEO, Bloom Institute of Technology', investmentRound: 'Seed', - image: investorImages['austen.jpg'] + image: investorImages['austen.jpg']! }, { name: 'Tom Preston-Werner', role: 'Founder, GitHub', investmentRound: 'Seed', - image: investorImages['TOM.jpg'] + image: investorImages['TOM.jpg']! }, { name: 'Tobias Lütke', role: 'CEO, Shopify', investmentRound: 'Seed', - image: investorImages['tobiaslutke.jpg'] + image: investorImages['tobiaslutke.jpg']! }, { name: 'Justin Hoffman', role: 'Former VP Sales, Elasticsearch', investmentRound: 'Seed', - image: investorImages['justinhoffman.jpg'] + image: investorImages['justinhoffman.jpg']! }, { name: 'Ry Walker', role: 'Founder, Astronomer', investmentRound: 'Seed', - image: investorImages['rywalker.jpg'] + image: investorImages['rywalker.jpg']! }, { name: 'Zachary Smith', role: 'Head of Edge Infrastructure, Equinix', investmentRound: 'Seed', - image: investorImages['zacharysmith.jpg'] + image: investorImages['zacharysmith.jpg']! }, { name: 'Sanjay Poonen', role: 'Former COO, VMware', investmentRound: 'Seed', - image: investorImages['sanjay.jpg'] + image: investorImages['sanjay.jpg']! }, { name: 'David Mytton', role: 'CEO, console.dev', investmentRound: 'Seed', - image: investorImages['davidmytton.jpg'] + image: investorImages['davidmytton.jpg']! }, { name: 'Peer Richelsen', role: 'CEO, Cal.com', investmentRound: 'Seed', - image: investorImages['peer.jpg'] + image: investorImages['peer.jpg']! }, { name: 'Lester Lee', role: 'Founder, Slapdash', investmentRound: 'Seed', - image: investorImages['lesterlee.jpg'] + image: investorImages['lesterlee.jpg']! }, { name: 'Haoyuan Li', role: 'Founder, Alluxio', investmentRound: 'Seed', - image: investorImages['haoyuan.jpg'] + image: investorImages['haoyuan.jpg']! }, { name: 'Augusto Marietti', role: 'CEO, Kong', investmentRound: 'Seed', - image: investorImages['augusto.jpg'] + image: investorImages['augusto.jpg']! }, { name: 'Vijay Sharma', role: 'CEO, Belong', investmentRound: 'Seed', - image: investorImages['vijay.jpg'] + image: investorImages['vijay.jpg']! }, { name: 'Naveen R', role: 'Founder, NocoDB', investmentRound: 'Seed', - image: investorImages['naveen.jpg'] + image: investorImages['naveen.jpg']! } ]; diff --git a/apps/landing/src/utils/markdownParse.ts b/apps/landing/src/utils/markdownParse.ts index 68166f583..716bd5d88 100644 --- a/apps/landing/src/utils/markdownParse.ts +++ b/apps/landing/src/utils/markdownParse.ts @@ -41,10 +41,10 @@ export function parseMarkdown(markdownRaw: string): MarkdownParsed { return text; } else { const rawText = rawSplit[index], - meta = rawText.split(/\r?\n/)[0].trim(), + meta = rawText!.split(/\r?\n/)[0]!.trim(), kind = meta.split(' ')[0], name = meta.split(' ')[1], - extra = meta.substring(kind.length + name.length + 2), + extra = meta.substring(kind!.length + name!.length + 2), content = text.substring(meta.length + 1, text.length).trim(); // console.log({ kind, name, extra, content }); diff --git a/apps/mobile/scripts/postinstall.js b/apps/mobile/scripts/postinstall.js index 5965af9ea..c79431e6f 100644 --- a/apps/mobile/scripts/postinstall.js +++ b/apps/mobile/scripts/postinstall.js @@ -1,4 +1,4 @@ -// @ts-check +// @ts-ignore let fs = require('fs-extra'); let path = require('path'); diff --git a/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx b/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx index 0852632a8..b71768502 100644 --- a/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx +++ b/apps/mobile/src/components/dialog/CreateLibraryDialog.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { queryClient, useBridgeMutation } from '@sd/client'; +import { Input } from '~/components/form/Input'; import Dialog from '~/components/layout/Dialog'; -import { Input } from '~/components/primitive/Input'; import { currentLibraryStore } from '~/utils/nav'; type Props = { diff --git a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx index da0c1c85a..66bea4093 100644 --- a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx +++ b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx @@ -35,7 +35,7 @@ const DrawerLibraryManager = () => { : 'border-b-app-box border-sidebar-line bg-sidebar-button rounded-t-md' )} > - {currentLibrary.config.name} + {currentLibrary?.config.name} { {library.config.name} diff --git a/apps/mobile/src/components/drawer/DrawerLocations.tsx b/apps/mobile/src/components/drawer/DrawerLocations.tsx index 6d25154f6..41507c262 100644 --- a/apps/mobile/src/components/drawer/DrawerLocations.tsx +++ b/apps/mobile/src/components/drawer/DrawerLocations.tsx @@ -36,7 +36,7 @@ type DrawerLocationsProp = { const DrawerLocations = ({ stackName }: DrawerLocationsProp) => { const navigation = useNavigation(); - const importModalRef = useRef(); + const importModalRef = useRef(null); const { data: locations } = useLibraryQuery(['locations.list'], { keepPreviousData: true }); @@ -62,7 +62,7 @@ const DrawerLocations = ({ stackName }: DrawerLocationsProp) => { ))} {/* Add Location */} - importModalRef.current.present()}> + importModalRef.current?.present()}> Add Location diff --git a/apps/mobile/src/components/drawer/DrawerTags.tsx b/apps/mobile/src/components/drawer/DrawerTags.tsx index 1f014ff58..1d07ee50d 100644 --- a/apps/mobile/src/components/drawer/DrawerTags.tsx +++ b/apps/mobile/src/components/drawer/DrawerTags.tsx @@ -37,7 +37,7 @@ const DrawerTags = ({ stackName }: DrawerTagsProp) => { const { data: tags } = useLibraryQuery(['tags.list'], { keepPreviousData: true }); - const createTagModalRef = useRef(); + const createTagModalRef = useRef(null); return ( { {tags?.map((tag) => ( navigation.navigate(stackName, { screen: 'Tag', @@ -61,7 +61,7 @@ const DrawerTags = ({ stackName }: DrawerTagsProp) => { ))} {/* Add Tag */} - createTagModalRef.current.present()}> + createTagModalRef.current?.present()}> Add Tag diff --git a/apps/mobile/src/components/explorer/Explorer.tsx b/apps/mobile/src/components/explorer/Explorer.tsx index 0c69f5303..b27064c5d 100644 --- a/apps/mobile/src/components/explorer/Explorer.tsx +++ b/apps/mobile/src/components/explorer/Explorer.tsx @@ -14,7 +14,7 @@ import FileItem from './FileItem'; import FileRow from './FileRow'; type ExplorerProps = { - data: ExplorerData; + data: ExplorerData | undefined; }; const Explorer = ({ data }: ExplorerProps) => { @@ -22,7 +22,7 @@ const Explorer = ({ data }: ExplorerProps) => { const [layoutMode, setLayoutMode] = useState<'grid' | 'list'>(getExplorerStore().layoutMode); - function changeLayoutMode(kind) { + function changeLayoutMode(kind: 'grid' | 'list') { // We need to keep layoutMode as a state to make sure flash-list re-renders. setLayoutMode(kind); getExplorerStore().layoutMode = kind; @@ -35,7 +35,7 @@ const Explorer = ({ data }: ExplorerProps) => { navigation.push('Location', { id: data.item.location_id, path: data.item.materialized_path }); } else { setData(data); - modalRef.current.present(); + modalRef.current?.present(); } } diff --git a/apps/mobile/src/components/explorer/FileThumb.tsx b/apps/mobile/src/components/explorer/FileThumb.tsx index d97c8e885..10fca052c 100644 --- a/apps/mobile/src/components/explorer/FileThumb.tsx +++ b/apps/mobile/src/components/explorer/FileThumb.tsx @@ -1,3 +1,4 @@ +import { PropsWithChildren } from 'react'; import { Image, View } from 'react-native'; import { DocumentDirectoryPath } from 'react-native-fs'; import { ExplorerItem, isObject, isPath } from '@sd/client'; @@ -18,7 +19,7 @@ type FileThumbProps = { export const getThumbnailUrlById = (casId: string) => `${DocumentDirectoryPath}/thumbnails/${encodeURIComponent(casId)}.webp`; -const FileThumbWrapper = ({ children, size = 1 }) => ( +const FileThumbWrapper = ({ children, size = 1 }: PropsWithChildren<{ size: number }>) => ( {children} @@ -38,7 +39,7 @@ export default function FileThumb({ data, size = 1, kind }: FileThumbProps) { ); const casId = isObject(data) ? data.item.file_paths[0]?.cas_id : data.item.cas_id; - if (!casId) return undefined; + if (!casId) return null; // Icon let icon = undefined; diff --git a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx index d50a03356..c44d80aa4 100644 --- a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx +++ b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx @@ -12,7 +12,7 @@ type Props = { const InfoTagPills = ({ data, style }: Props) => { const objectData = data ? (isObject(data) ? data.item : data.item.object) : null; - const tagsQuery = useLibraryQuery(['tags.getForObject', objectData?.id], { + const tagsQuery = useLibraryQuery(['tags.getForObject', objectData?.id ?? -1], { enabled: Boolean(objectData) }); @@ -25,7 +25,7 @@ const InfoTagPills = ({ data, style }: Props) => { {/* Kind */} {/* Extension */} {item.extension && } @@ -33,7 +33,7 @@ const InfoTagPills = ({ data, style }: Props) => { {tagsQuery.data?.map((tag) => ( diff --git a/apps/mobile/src/components/form/ColorPicker.tsx b/apps/mobile/src/components/form/ColorPicker.tsx new file mode 100644 index 000000000..9f45253c2 --- /dev/null +++ b/apps/mobile/src/components/form/ColorPicker.tsx @@ -0,0 +1,38 @@ +import React from 'react'; +import WheelColorPicker from 'react-native-wheel-color-picker'; +import { tw } from '~/lib/tailwind'; + +type ColorPickerProps = { + color: string; + onColorChangeComplete: (color: string) => void; +}; + +const defaultPalette = [ + tw.color('blue-500'), + tw.color('red-500'), + tw.color('green-500'), + tw.color('yellow-500'), + tw.color('purple-500'), + tw.color('pink-500'), + tw.color('gray-500'), + tw.color('black'), + tw.color('white') +]; + +const ColorPicker = ({ color, onColorChangeComplete }: ColorPickerProps) => { + return ( + + ); +}; + +export default ColorPicker; diff --git a/apps/mobile/src/components/primitive/Input.tsx b/apps/mobile/src/components/form/Input.tsx similarity index 100% rename from apps/mobile/src/components/primitive/Input.tsx rename to apps/mobile/src/components/form/Input.tsx diff --git a/apps/mobile/src/components/primitive/Switch.tsx b/apps/mobile/src/components/form/Switch.tsx similarity index 100% rename from apps/mobile/src/components/primitive/Switch.tsx rename to apps/mobile/src/components/form/Switch.tsx diff --git a/apps/mobile/src/components/layout/Modal.tsx b/apps/mobile/src/components/layout/Modal.tsx index 3aa2f07df..89871f5cb 100644 --- a/apps/mobile/src/components/layout/Modal.tsx +++ b/apps/mobile/src/components/layout/Modal.tsx @@ -31,7 +31,7 @@ const ModalHandle = (props: ModalHandle) => ( > {props.showCloseButton && ( props.modalRef.current.close()} + onPress={() => props.modalRef.current?.close()} style={tw`bg-app-button absolute top-5 right-4 h-7 w-7 items-center justify-center rounded-full`} > @@ -101,7 +101,7 @@ export const ConfirmModal = forwardRef((props, ref) return ( <> {props.trigger && ( - modalRef.current.present()}>{props.trigger} + modalRef.current?.present()}>{props.trigger} )} ((props, ref) style={tw`flex-1`} size="lg" disabled={props.loading} // Disables Close button if loading - onPress={() => modalRef.current.close()} + onPress={() => modalRef.current?.close()} > Close diff --git a/apps/mobile/src/components/layout/VirtualizedListWrapper.tsx b/apps/mobile/src/components/layout/VirtualizedListWrapper.tsx index 9f09840bb..a222f66e5 100644 --- a/apps/mobile/src/components/layout/VirtualizedListWrapper.tsx +++ b/apps/mobile/src/components/layout/VirtualizedListWrapper.tsx @@ -1,6 +1,7 @@ +import { PropsWithChildren } from 'react'; import { FlatList } from 'react-native'; -export default function VirtualizedListWrapper({ children }) { +export default function VirtualizedListWrapper({ children }: PropsWithChildren) { return ( ; const ArrowDownIcon = () => ; const SortByMenu = () => { - const [sortBy, setSortBy] = useState('name'); + const [sortBy, setSortBy] = useState('name'); const [sortDirection, setSortDirection] = useState('asc' as 'asc' | 'desc'); return ( @@ -32,7 +34,9 @@ const SortByMenu = () => { {Object.entries(sortOptions).map(([value, text]) => ( { @@ -42,7 +46,7 @@ const SortByMenu = () => { } // Reset sort direction to descending sortDirection === 'asc' && setSortDirection('desc'); - setSortBy(value); + setSortBy(value as SortByType); }} /> ))} diff --git a/apps/mobile/src/components/modal/ImportModal.tsx b/apps/mobile/src/components/modal/ImportModal.tsx index f371c5244..6d82d4347 100644 --- a/apps/mobile/src/components/modal/ImportModal.tsx +++ b/apps/mobile/src/components/modal/ImportModal.tsx @@ -1,14 +1,15 @@ -import * as ML from 'expo-media-library'; import { forwardRef, useCallback } from 'react'; -import { Alert, Platform, Text, View } from 'react-native'; +import { Alert, Text, View } from 'react-native'; import DocumentPicker from 'react-native-document-picker'; import { useLibraryMutation } from '@sd/client'; -// import RFS from 'react-native-fs'; import { Modal, ModalRef } from '~/components/layout/Modal'; import { Button } from '~/components/primitive/Button'; import useForwardedRef from '~/hooks/useForwardedRef'; import { tw } from '~/lib/tailwind'; +// import RFS from 'react-native-fs'; +// import * as ML from 'expo-media-library'; + // WIP component const ImportModal = forwardRef((_, ref) => { const modalRef = useForwardedRef(ref); @@ -29,6 +30,8 @@ const ImportModal = forwardRef((_, ref) => { presentationStyle: 'pageSheet' }); + if (!response) return; + createLocation({ path: decodeURIComponent(response.uri.replace('file://', '')), indexer_rules_ids: [] @@ -43,70 +46,70 @@ const ImportModal = forwardRef((_, ref) => { Alert.alert('TODO'); return; - // Check if we have full access to the photos library - let permission = await ML.getPermissionsAsync(); - // {"accessPrivileges": "none", "canAskAgain": true, "expires": "never", "granted": false, "status": "undetermined"} + // // Check if we have full access to the photos library + // let permission = await ML.getPermissionsAsync(); + // // {"accessPrivileges": "none", "canAskAgain": true, "expires": "never", "granted": false, "status": "undetermined"} - if ( - permission.status === ML.PermissionStatus.UNDETERMINED || - (permission.status === ML.PermissionStatus.DENIED && permission.canAskAgain) - ) { - permission = await ML.requestPermissionsAsync(); - } + // if ( + // permission.status === ML.PermissionStatus.UNDETERMINED || + // (permission.status === ML.PermissionStatus.DENIED && permission.canAskAgain) + // ) { + // permission = await ML.requestPermissionsAsync(); + // } - // Permission Denied - if (permission.status === ML.PermissionStatus.DENIED) { - Alert.alert( - 'Permission required', - 'You need to grant access to your photos library to import your photos/videos.' - ); - return; - } + // // Permission Denied + // if (permission.status === ML.PermissionStatus.DENIED) { + // Alert.alert( + // 'Permission required', + // 'You need to grant access to your photos library to import your photos/videos.' + // ); + // return; + // } - // Limited Permission (Can't access path) - if (permission.accessPrivileges === 'limited') { - Alert.alert( - 'Limited access', - 'You need to grant full access to your photos library to import your photos/videos.' - ); - return; - } + // // Limited Permission (Can't access path) + // if (permission.accessPrivileges === 'limited') { + // Alert.alert( + // 'Limited access', + // 'You need to grant full access to your photos library to import your photos/videos.' + // ); + // return; + // } - // If android return error for now... - if (Platform.OS !== 'ios') { - Alert.alert('Not supported', 'Not supported for now...'); - return; - } + // // If android return error for now... + // if (Platform.OS !== 'ios') { + // Alert.alert('Not supported', 'Not supported for now...'); + // return; + // } - // And for IOS we are assuming every asset is under the same path (which is not the case) + // // And for IOS we are assuming every asset is under the same path (which is not the case) - // file:///Users/xxxx/Library/Developer/CoreSimulator/Devices/F99C471F-C9F9-458D-8B87-BCC4B46C644C/data/Media/DCIM/100APPLE/IMG_0004.JPG - // file:///var/mobile/Media/DCIM/108APPLE/IMG_8332.JPG‘ + // // file:///Users/xxxx/Library/Developer/CoreSimulator/Devices/F99C471F-C9F9-458D-8B87-BCC4B46C644C/data/Media/DCIM/100APPLE/IMG_0004.JPG + // // file:///var/mobile/Media/DCIM/108APPLE/IMG_8332.JPG‘ - const firstAsset = (await ML.getAssetsAsync({ first: 1 })).assets[0]; + // const firstAsset = (await ML.getAssetsAsync({ first: 1 })).assets[0]; - if (!firstAsset) return; + // if (!firstAsset) return; - // Gets asset uri: ph://CC95F08C-88C3-4012-9D6D-64A413D254B3 - const assetId = firstAsset.id; - // Gets Actual Path - const path = (await ML.getAssetInfoAsync(assetId)).localUri; + // // Gets asset uri: ph://CC95F08C-88C3-4012-9D6D-64A413D254B3 + // const assetId = firstAsset?.id; + // // Gets Actual Path + // const path = (await ML.getAssetInfoAsync(assetId)).localUri; - const libraryPath = Platform.select({ - android: '', - ios: path.replace('file://', '').split('Media/DCIM/')[0] + 'Media/DCIM/' - }); + // const libraryPath = Platform.select({ + // android: '', + // ios: path.replace('file://', '').split('Media/DCIM/')[0] + 'Media/DCIM/' + // }); - createLocation({ - path: libraryPath, - indexer_rules_ids: [] - }); + // createLocation({ + // path: libraryPath, + // indexer_rules_ids: [] + // }); // const assets = await ML.getAssetsAsync({ mediaType: ML.MediaType.photo }); // assets.assets.map(async (i) => { // console.log((await ML.getAssetInfoAsync(i)).localUri); // }); - }, [createLocation]); + }, []); // const testFN = useCallback(async () => { // console.log(RFS.PicturesDirectoryPath); diff --git a/apps/mobile/src/components/modal/confirm-modals/DeleteLibraryModal.tsx b/apps/mobile/src/components/modal/confirm-modals/DeleteLibraryModal.tsx index a89f5a6b6..26a5f64ca 100644 --- a/apps/mobile/src/components/modal/confirm-modals/DeleteLibraryModal.tsx +++ b/apps/mobile/src/components/modal/confirm-modals/DeleteLibraryModal.tsx @@ -9,7 +9,7 @@ type Props = { }; const DeleteLibraryModal = ({ trigger, onSubmit, libraryUuid }: Props) => { - const modalRef = useRef(); + const modalRef = useRef(null); const { mutate: deleteLibrary, isLoading: deleteLibLoading } = useBridgeMutation( 'library.delete', @@ -19,12 +19,13 @@ const DeleteLibraryModal = ({ trigger, onSubmit, libraryUuid }: Props) => { onSubmit?.(); }, onSettled: () => { - modalRef.current.close(); + modalRef.current?.close(); } } ); return ( { - const modalRef = useRef(); + const modalRef = useRef(null); const { mutate: deleteLoc, isLoading: deleteLocLoading } = useLibraryMutation( 'locations.delete', @@ -18,7 +18,7 @@ const DeleteLocationModal = ({ trigger, onSubmit, locationId }: Props) => { onSubmit?.(); }, onSettled: () => { - modalRef.current.close(); + modalRef.current?.close(); } } ); diff --git a/apps/mobile/src/components/modal/confirm-modals/DeleteTagModal.tsx b/apps/mobile/src/components/modal/confirm-modals/DeleteTagModal.tsx index b0af9310c..1033e24ea 100644 --- a/apps/mobile/src/components/modal/confirm-modals/DeleteTagModal.tsx +++ b/apps/mobile/src/components/modal/confirm-modals/DeleteTagModal.tsx @@ -9,19 +9,20 @@ type Props = { }; const DeleteTagModal = ({ trigger, onSubmit, tagId }: Props) => { - const modalRef = useRef(); + const modalRef = useRef(null); const { mutate: deleteTag, isLoading: deleteTagLoading } = useLibraryMutation('tags.delete', { onSuccess: () => { onSubmit?.(); }, onSettled: () => { - modalRef.current.close(); + modalRef.current?.close(); } }); return ( { {/* Thumbnail/Icon */} - fileInfoRef.current.present()}> + fileInfoRef.current?.present()}> {/* Name + Extension */} - {item.name} - {item.extension && `.${item.extension}`} + {item?.name} + {item?.extension && `.${item?.extension}`} @@ -86,12 +86,12 @@ export const ActionsModal = () => { {' '} - {dayjs(item.date_created).format('MMM Do YYYY')} + {dayjs(item?.date_created).format('MMM Do YYYY')} - + {objectData && } {/* Actions */} @@ -99,7 +99,7 @@ export const ActionsModal = () => { fileInfoRef.current.present()} + onPress={() => fileInfoRef.current?.present()} /> diff --git a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx index afe62de3b..9283d44fd 100644 --- a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx +++ b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx @@ -31,7 +31,7 @@ function MetaItem({ title, value, icon }: MetaItemProps) { <> - {icon && } + {Icon && } {title} {value} @@ -42,7 +42,7 @@ function MetaItem({ title, value, icon }: MetaItemProps) { } type FileInfoModalProps = { - data: ExplorerItem; + data: ExplorerItem | null; }; const FileInfoModal = forwardRef((props, ref) => { @@ -69,13 +69,13 @@ const FileInfoModal = forwardRef((props, ref) => { {data && ( {/* Back Button */} - modalRef.current.close()} style={tw`absolute z-10 ml-4`}> + modalRef.current?.close()} style={tw`absolute z-10 ml-4`}> {/* File Icon / Name */} - {item.name} + {item?.name} {/* Details */} @@ -99,19 +99,21 @@ const FileInfoModal = forwardRef((props, ref) => { {/* Indexed */} {filePathData && ( <> {/* TODO: Note */} - + {filePathData.cas_id && ( + + )} {/* Checksum */} {filePathData?.integrity_checksum && ( ((_, ref) => { }, onSettled: () => { // Close modal - modalRef.current.dismiss(); + modalRef.current?.dismiss(); } }); useEffect(() => { - modalRef.current.snapToIndex(showPicker ? 1 : 0); + modalRef.current?.snapToIndex(showPicker ? 1 : 0); }, [modalRef, showPicker]); return ( @@ -70,27 +70,7 @@ const CreateTagModal = forwardRef((_, ref) => { {showPicker && ( - setTagColor(color)} - swatchesLast={false} - palette={[ - tw.color('blue-500'), - tw.color('red-500'), - tw.color('green-500'), - tw.color('yellow-500'), - tw.color('purple-500'), - tw.color('pink-500'), - tw.color('gray-500'), - tw.color('black'), - tw.color('white') - ]} - /> + setTagColor(color)} /> )} diff --git a/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx b/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx index ccbeccf0e..3cf50ac1d 100644 --- a/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx +++ b/apps/mobile/src/components/modal/tag/UpdateTagModal.tsx @@ -1,11 +1,11 @@ import { forwardRef, useEffect, useState } from 'react'; -import { Pressable, Text, View } from 'react-native'; -import ColorPicker from 'react-native-wheel-color-picker'; +import { ColorValue, Pressable, Text, View } from 'react-native'; import { Tag, queryClient, useLibraryMutation } from '@sd/client'; import { FadeInAnimation } from '~/components/animation/layout'; +import ColorPicker from '~/components/form/ColorPicker'; +import { Input } from '~/components/form/Input'; import { Modal, ModalRef } from '~/components/layout/Modal'; import { Button } from '~/components/primitive/Button'; -import { Input } from '~/components/primitive/Input'; import useForwardedRef from '~/hooks/useForwardedRef'; import { tw, twStyle } from '~/lib/tailwind'; @@ -17,8 +17,8 @@ type Props = { const UpdateTagModal = forwardRef((props, ref) => { const modalRef = useForwardedRef(ref); - const [tagName, setTagName] = useState(props.tag.name); - const [tagColor, setTagColor] = useState(props.tag.color); + const [tagName, setTagName] = useState(props.tag.name!); + const [tagColor, setTagColor] = useState(props.tag.color!); const [showPicker, setShowPicker] = useState(false); const { mutate: updateTag, isLoading } = useLibraryMutation('tags.update', { @@ -31,12 +31,12 @@ const UpdateTagModal = forwardRef((props, ref) => { props.onSubmit?.(); }, onSettled: () => { - modalRef.current.dismiss(); + modalRef.current?.dismiss(); } }); useEffect(() => { - modalRef.current.snapToIndex(showPicker ? 1 : 0); + modalRef.current?.snapToIndex(showPicker ? 1 : 0); }, [modalRef, showPicker]); return ( @@ -63,32 +63,12 @@ const UpdateTagModal = forwardRef((props, ref) => { style={twStyle({ backgroundColor: tagColor }, 'h-5 w-5 rounded-full')} /> {/* TODO: Make this editable. Need to make sure color is a valid hexcode and update the color on picker etc. etc. */} - + {showPicker && ( - setTagColor(color)} - swatchesLast={false} - palette={[ - tw.color('blue-500'), - tw.color('red-500'), - tw.color('green-500'), - tw.color('yellow-500'), - tw.color('purple-500'), - tw.color('pink-500'), - tw.color('gray-500'), - tw.color('black'), - tw.color('white') - ]} - /> + setTagColor(color)} /> )} diff --git a/apps/mobile/src/lib/rspcReactNativeTransport.ts b/apps/mobile/src/lib/rspcReactNativeTransport.ts index f79f89859..6cca108d9 100644 --- a/apps/mobile/src/lib/rspcReactNativeTransport.ts +++ b/apps/mobile/src/lib/rspcReactNativeTransport.ts @@ -79,7 +79,7 @@ export function createReactNativeClient(): TRPCWebSocketClient { body = JSON.stringify(outgoing); } - SDCore.sd_core_msg(body).then((rawData) => { + SDCore.sd_core_msg(body).then((rawData: string) => { const data = JSON.parse(rawData); if (Array.isArray(data)) { for (const payload of data) { diff --git a/apps/mobile/src/main.tsx b/apps/mobile/src/main.tsx index fecec9a7c..3c202a35e 100644 --- a/apps/mobile/src/main.tsx +++ b/apps/mobile/src/main.tsx @@ -58,7 +58,7 @@ if (Platform.OS === 'ios') { const App = lazy(async () => { const keys = await AsyncStorage.getAllKeys(); const values = await AsyncStorage.multiGet(keys); - values.forEach(([key, value]) => _localStorage.set(key, value)); + values.forEach(([key, value]) => _localStorage.set(key, value!)); return await import('./App'); }); diff --git a/apps/mobile/src/screens/Location.tsx b/apps/mobile/src/screens/Location.tsx index d2ae74bb7..b4257401c 100644 --- a/apps/mobile/src/screens/Location.tsx +++ b/apps/mobile/src/screens/Location.tsx @@ -11,7 +11,7 @@ export default function LocationScreen({ navigation, route }: SharedScreenProps< 'locations.getExplorerData', { location_id: id, - path: path || '', + path: path ?? '', limit: 100, cursor: null } @@ -26,14 +26,14 @@ export default function LocationScreen({ navigation, route }: SharedScreenProps< }); } else { navigation.setOptions({ - title: data?.context.name + title: data?.context.name ?? 'Location' }); } }, [data, navigation, path]); useEffect(() => { getExplorerStore().locationId = id; - getExplorerStore().path = path; + getExplorerStore().path = path ?? ''; }, [id, path]); return ; diff --git a/apps/mobile/src/screens/NotFound.tsx b/apps/mobile/src/screens/NotFound.tsx index 5f566ec4b..527009e20 100644 --- a/apps/mobile/src/screens/NotFound.tsx +++ b/apps/mobile/src/screens/NotFound.tsx @@ -6,7 +6,15 @@ export default function NotFoundScreen({ navigation }: RootStackScreenProps<'Not return ( This screen doesn't exist. - navigation.replace('Root')} style={tw`mt-4 py-4`}> + + navigation.replace('Root', { + screen: 'Home', + params: { screen: 'OverviewStack', params: { screen: 'Overview' } } + }) + } + style={tw`mt-4 py-4`} + > Go to home screen! diff --git a/apps/mobile/src/screens/Tag.tsx b/apps/mobile/src/screens/Tag.tsx index 5ff770bd7..f5ce4008b 100644 --- a/apps/mobile/src/screens/Tag.tsx +++ b/apps/mobile/src/screens/Tag.tsx @@ -12,7 +12,7 @@ export default function TagScreen({ navigation, route }: SharedScreenProps<'Tag' useEffect(() => { // Set screen title to tag name. navigation.setOptions({ - title: data?.context.name + title: data?.context.name ?? 'Tag' }); }, [data?.context.name, navigation]); diff --git a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx index 352795992..c38437d42 100644 --- a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx +++ b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Text, View } from 'react-native'; import { useBridgeQuery } from '@sd/client'; +import { Input } from '~/components/form/Input'; import Card from '~/components/layout/Card'; import Divider from '~/components/primitive/Divider'; -import { Input } from '~/components/primitive/Input'; import { tw } from '~/lib/tailwind'; import { SettingsStackScreenProps } from '~/navigation/SettingsNavigator'; diff --git a/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx b/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx index 5df271be8..a4cb55c8a 100644 --- a/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx +++ b/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { Controller, useForm } from 'react-hook-form'; import { Alert, Text, View } from 'react-native'; import { useBridgeMutation, useLibraryContext } from '@sd/client'; +import { Input } from '~/components/form/Input'; +import { Switch } from '~/components/form/Switch'; import { Button } from '~/components/primitive/Button'; -import { Input } from '~/components/primitive/Input'; -import { Switch } from '~/components/primitive/Switch'; import { SettingsContainer } from '~/components/settings/SettingsContainer'; import { SettingsItem } from '~/components/settings/SettingsItem'; import { useAutoForm } from '~/hooks/useAutoForm'; diff --git a/apps/mobile/src/screens/settings/library/TagsSettings.tsx b/apps/mobile/src/screens/settings/library/TagsSettings.tsx index c766908bc..bc243ef70 100644 --- a/apps/mobile/src/screens/settings/library/TagsSettings.tsx +++ b/apps/mobile/src/screens/settings/library/TagsSettings.tsx @@ -11,7 +11,7 @@ import { tw, twStyle } from '~/lib/tailwind'; import { SettingsStackScreenProps } from '~/navigation/SettingsNavigator'; function TagItem({ tag, index }: { tag: Tag; index: number }) { - const updateTagModalRef = useRef(); + const updateTagModalRef = useRef(null); const renderRightActions = ( progress: Animated.AnimatedInterpolation, @@ -29,7 +29,7 @@ function TagItem({ tag, index }: { tag: Tag; index: number }) { style={[tw`flex flex-row items-center`, { transform: [{ translateX: translate }] }]} > swipeable.close()} /> - updateTagModalRef.current.present()}> + updateTagModalRef.current?.present()}> - + {tag.name} diff --git a/apps/mobile/src/utils/nav.ts b/apps/mobile/src/utils/nav.ts index 528563ef9..f9d260de6 100644 --- a/apps/mobile/src/utils/nav.ts +++ b/apps/mobile/src/utils/nav.ts @@ -1,6 +1,7 @@ import { DrawerNavigationState, ParamListBase, + Route, getFocusedRouteNameFromRoute } from '@react-navigation/native'; import { valtioPersist } from '@sd/client'; @@ -9,7 +10,9 @@ export const currentLibraryStore = valtioPersist('sdActiveLibrary', { id: null as string | null }); -export const getActiveRouteFromState = function (state: any) { +export const getActiveRouteFromState = function ( + state: any +): Partial> { if (!state.routes || state.routes.length === 0 || state.index >= state.routes.length) { return state; } diff --git a/apps/mobile/tsconfig.json b/apps/mobile/tsconfig.json index 7d8e6d327..8645d920e 100644 --- a/apps/mobile/tsconfig.json +++ b/apps/mobile/tsconfig.json @@ -1,14 +1,24 @@ { - "extends": "expo/tsconfig.base", "compilerOptions": { + "allowJs": true, + "esModuleInterop": true, + "jsx": "react-native", + "lib": ["DOM", "ESNext"], + "moduleResolution": "node", + "resolveJsonModule": true, + "skipLibCheck": true, "target": "ESNext", "module": "ESNext", "noEmit": true, "paths": { "~/*": ["./src/*"] }, - "jsx": "react-native" + "strict": true, + "noUncheckedIndexedAccess": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true }, + "exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"], "references": [ { "path": "../../packages/client" diff --git a/packages/config/base.tsconfig.json b/packages/config/base.tsconfig.json index cd0eefbe6..be3ed9350 100644 --- a/packages/config/base.tsconfig.json +++ b/packages/config/base.tsconfig.json @@ -2,25 +2,21 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "Default", "compilerOptions": { - // Actual type stuff "strict": true, "jsx": "react-jsx", "esModuleInterop": true, - // Various configs "skipLibCheck": true, "preserveWatchOutput": true, "forceConsistentCasingInFileNames": true, "allowSyntheticDefaultImports": true, - // Project references stuff + "noUncheckedIndexedAccess": true, "composite": true, "declaration": true, "emitDeclarationOnly": true, - // Module stuff "moduleResolution": "node", "resolveJsonModule": true, "module": "ESNext", "target": "ESNext", - // Extra types "types": ["vite-plugin-svgr/client", "vite/client"] } } diff --git a/packages/interface/src/AppRouter.tsx b/packages/interface/src/AppRouter.tsx index 685a4c76f..211e79967 100644 --- a/packages/interface/src/AppRouter.tsx +++ b/packages/interface/src/AppRouter.tsx @@ -14,7 +14,7 @@ function Index() { const currentLibrary = libraries.data.find((l) => l.uuid === currentLibraryCache.id); - const libraryId = currentLibrary ? currentLibrary.uuid : libraries.data[0].uuid; + const libraryId = currentLibrary ? currentLibrary.uuid : libraries.data[0]?.uuid; return ; } diff --git a/packages/interface/src/components/dialog/EncryptFileDialog.tsx b/packages/interface/src/components/dialog/EncryptFileDialog.tsx index e84fbf281..bde7df3a5 100644 --- a/packages/interface/src/components/dialog/EncryptFileDialog.tsx +++ b/packages/interface/src/components/dialog/EncryptFileDialog.tsx @@ -35,7 +35,7 @@ export const EncryptFileDialog = ({ ...props }: EncryptDialogProps) => { const keys = useLibraryQuery(['keys.list']); const mountedUuids = useLibraryQuery(['keys.listMounted'], { onSuccess: (data) => { - UpdateKey(data[0]); + UpdateKey(data[0] ?? ''); } }); diff --git a/packages/interface/src/components/dialog/EraseFileDialog.tsx b/packages/interface/src/components/dialog/EraseFileDialog.tsx index bd0b9dd85..4632710a0 100644 --- a/packages/interface/src/components/dialog/EraseFileDialog.tsx +++ b/packages/interface/src/components/dialog/EraseFileDialog.tsx @@ -56,9 +56,9 @@ export const EraseFileDialog = (props: EraseDialogProps) => { min={1} step={1} defaultValue={[4]} - onValueChange={(e) => { - setPasses(e); - form.setValue('passes', e[0]); + onValueChange={(val) => { + setPasses(val); + form.setValue('passes', val[0] ?? 1); }} /> diff --git a/packages/interface/src/components/dialog/KeyViewerDialog.tsx b/packages/interface/src/components/dialog/KeyViewerDialog.tsx index c05ff6e98..76331beca 100644 --- a/packages/interface/src/components/dialog/KeyViewerDialog.tsx +++ b/packages/interface/src/components/dialog/KeyViewerDialog.tsx @@ -41,7 +41,7 @@ export const KeyViewerDialog = (props: KeyViewerDialogProps) => { const keys = useLibraryQuery(['keys.list'], { onSuccess: (data) => { if (key === '' && data.length !== 0) { - setKey(data[0].uuid); + setKey(data[0]?.uuid ?? ''); } } }); diff --git a/packages/interface/src/components/explorer/VirtualizedList.tsx b/packages/interface/src/components/explorer/VirtualizedList.tsx index bf14c68ac..1f63655d5 100644 --- a/packages/interface/src/components/explorer/VirtualizedList.tsx +++ b/packages/interface/src/components/explorer/VirtualizedList.tsx @@ -145,7 +145,7 @@ export const VirtualizedList = memo(({ data, context, onScroll }: Props) => { kind="list" isSelected={getExplorerStore().selectedRowIndex === virtualRow.index} index={virtualRow.index} - item={data[virtualRow.index]} + item={data[virtualRow.index]!} /> ) : ( [...Array(amountOfColumns)].map((_, i) => { diff --git a/packages/interface/src/components/key/KeyMounter.tsx b/packages/interface/src/components/key/KeyMounter.tsx index 72fe070d8..2c351f656 100644 --- a/packages/interface/src/components/key/KeyMounter.tsx +++ b/packages/interface/src/components/key/KeyMounter.tsx @@ -1,8 +1,8 @@ import cryptoRandomString from 'crypto-random-string'; import { Eye, EyeSlash, Info } from 'phosphor-react'; import { useEffect, useRef, useState } from 'react'; -import { Algorithm, useLibraryMutation, useLibraryQuery } from '@sd/client'; -import { Button, CategoryHeading, Input, Select, SelectOption, Switch, cva, tw } from '@sd/ui'; +import { Algorithm, useLibraryMutation } from '@sd/client'; +import { Button, CategoryHeading, Input, Select, SelectOption, Switch, tw } from '@sd/ui'; import { getHashingAlgorithmSettings } from '../../screens/settings/library/KeysSetting'; import Slider from '../primitive/Slider'; import { Tooltip } from '../tooltip/Tooltip'; @@ -67,12 +67,12 @@ export function KeyMounter() { min={8} step={4} defaultValue={[64]} - onValueChange={(e) => { - setSliderValue(e); - setKey(generatePassword(e[0])); + onValueChange={(val) => { + setSliderValue(val); + setKey(generatePassword(val[0] ?? 8)); }} onClick={() => { - setKey(generatePassword(sliderValue[0])); + setKey(generatePassword(sliderValue[0] ?? 8)); }} /> diff --git a/packages/interface/src/components/onboarding/helpers/screens.ts b/packages/interface/src/components/onboarding/helpers/screens.ts index 332972b1d..00a9c2f19 100644 --- a/packages/interface/src/components/onboarding/helpers/screens.ts +++ b/packages/interface/src/components/onboarding/helpers/screens.ts @@ -6,7 +6,7 @@ export const useCurrentOnboardingScreenKey = (): string | null => { const { pathname } = useLocation(); if (pathname.startsWith(`/${ONBOARDING_ROUTE_PREFIX_NAME}/`)) { - return pathname.split('/')[2]; + return pathname.split('/')[2] || null; } return null; diff --git a/packages/interface/src/components/os/TrafficLights.tsx b/packages/interface/src/components/os/TrafficLights.tsx index 04649d253..3ae9ab9d9 100644 --- a/packages/interface/src/components/os/TrafficLights.tsx +++ b/packages/interface/src/components/os/TrafficLights.tsx @@ -18,9 +18,9 @@ export function MacTrafficLights(props: TrafficLightsProps) { return (
- - - + + +
); } diff --git a/packages/interface/src/screens/settings/library/KeysSetting.tsx b/packages/interface/src/screens/settings/library/KeysSetting.tsx index 1eb86ddeb..6ed27fc96 100644 --- a/packages/interface/src/screens/settings/library/KeysSetting.tsx +++ b/packages/interface/src/screens/settings/library/KeysSetting.tsx @@ -312,7 +312,7 @@ const table: Record = { // not sure of a suitable place for this function export const getHashingAlgorithmSettings = (hashingAlgorithm: string): HashingAlgorithm => { - return table[hashingAlgorithm]; + return table[hashingAlgorithm] || { name: 'Argon2id', params: 'Standard' }; }; // not sure of a suitable place for this function