Skip to content

Commit 0e0aa05

Browse files
committed
fix: Log level and source field fixed for new component
1 parent 65ad623 commit 0e0aa05

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/back/importGame.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ async function importGameImage(image: CurationIndexImage, gameId: string, folder
494494
// Check if the image is its own file
495495
if (image.filePath !== undefined) {
496496
await fs.promises.mkdir(path.dirname(imagePath), { recursive: true });
497-
await fs.promises.access(image.filePath, fs.constants.R_OK).then(() => log.debug('TEST', 'CAN READ')).catch(() => log.debug('TEST', 'CAN NOT READ'));
497+
await fs.promises.access(image.filePath, fs.constants.R_OK);
498498
await fs.promises.copyFile(image.filePath, imagePath);
499499
}
500500
// Check if the image is extracted

src/renderer/components/LogBox.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ function LogRow({ index, style, logs, longestSource }: RowComponentProps<RowProp
4949

5050
export function LogBox(props: LogBoxProps) {
5151
const scale = useAppSelector(state => state.preferences.scaleValues.logs);
52+
const levelFilters = useAppSelector(state => state.preferences.showLogLevel);
53+
const sourceFilters = useAppSelector(state => state.preferences.showLogSource);
5254
const fontSize = Math.floor(calcScale(8, 24, scale));
5355

56+
const filteredLogs = props.logs.filter(l => levelFilters[l.logLevel as LogLevel]).filter(l => sourceFilters[l.source] !== false);
57+
5458
const rowHeight = (index: number, { logs }: RowProps) => {
5559
return (fontSize + 2) * logs[index].lineCount;
5660
};
@@ -63,10 +67,10 @@ export function LogBox(props: LogBoxProps) {
6367
style={{ fontSize: `${fontSize}px`, lineHeight: `${fontSize + 2}px`, height, maxHeight: undefined }}
6468
rowComponent={LogRow}
6569
rowProps={{
66-
logs: props.logs,
70+
logs: filteredLogs,
6771
longestSource: props.longestSource
6872
}}
69-
rowCount={props.logs.length}
73+
rowCount={filteredLogs.length}
7074
rowHeight={rowHeight}
7175
overscanCount={25} />;
7276
}}

0 commit comments

Comments
 (0)