Skip to content

Commit

Permalink
Merge branch 'main' into feat/camera-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-segning authored Mar 9, 2025
2 parents 8c2f6b1 + 13e12ef commit c552344
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15,880 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
browser: true,
es2021: true,
},
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
Expand Down
1 change: 0 additions & 1 deletion src/components/camera-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export function CameraInput(props: CameraInputProps) {
</button>
)}
{extractedData && !shouldTake && (
<pre className='bg-base-200 rounded-xl overflow-scroll h-[100px] w-full'>
{JSON.stringify(extractedData, null, 2)}
</pre>
)}
Expand Down
1 change: 1 addition & 0 deletions src/screens/scan.screen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CameraInput } from '@components/camera-input.tsx';
import React from 'react';
import { Header } from '../components/header.tsx';
import { CameraInput } from '@components/camera-input.tsx';

/**
* Scan screen
Expand Down
22 changes: 22 additions & 0 deletions src/store/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,25 @@ export const selectAiLoadingState = createSelector(
return total;
},
);

export const selectAiData = createSelector(
(ro: RootState) => ro.ai,
({ loadingData, loadingBarCodes, data, barCodes }) =>
loadingData || loadingBarCodes
? undefined
: {
data,
barCodes,
}
);

export const selectAiLoadingState = createSelector(
(ro: RootState) => ro.ai,
({ loadingData, loadingBarCodes, loadingText }) => {
let total = 0;
if (!loadingData) total++;
if (!loadingBarCodes) total++;
if (!loadingText) total++;
return total;
}
);
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import mkcert from 'vite-plugin-mkcert';
import { VitePWA } from 'vite-plugin-pwa';
import { robots } from 'vite-plugin-robots';
import tsconfigPaths from 'vite-tsconfig-paths';
import mkcert from 'vite-plugin-mkcert';

const baseEncode = (plaintext: string): string => {
const base =
Expand Down
Loading

0 comments on commit c552344

Please sign in to comment.