mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-01 14:22:34 -08:00
Fix scroll issues in logger + fix translations
This commit is contained in:
1 parent
f0a8f07ea1
commit
f005dd3c58
2 files changed
+10
-2
No files matched your search
@@ -887,7 +887,7 @@ settings-logs-export_all = Export all logs (.zip)
|
||||
settings-logs-export-title = Export logs
|
||||
settings-logs-export-all = All log files (.zip)
|
||||
settings-logs-export-all-description = Every log file, for bug reports
|
||||
settings-logs-export-origin = { $source } files only (.zip)
|
||||
settings-logs-export-source = { $source } files only (.zip)
|
||||
settings-logs-export-selected =
|
||||
{ $count ->
|
||||
[one] Export 1 selected file (.zip)
|
||||
|
||||
@@ -109,6 +109,7 @@ function LogRowView({
|
||||
|
||||
export function LogList({ rows, query }: { rows: LogRow[]; query: string }) {
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
const lastScrollTop = useRef(0);
|
||||
const [atBottom, setAtBottom] = useState(true);
|
||||
const [lastSeenId, setLastSeenId] = useState(-1);
|
||||
const [expanded, setExpanded] = useState<Set<number>>(new Set());
|
||||
@@ -136,8 +137,15 @@ export function LogList({ rows, query }: { rows: LogRow[]; query: string }) {
|
||||
const onScroll = () => {
|
||||
const el = scrollRef.current;
|
||||
if (!el) return;
|
||||
const movedUp = el.scrollTop < lastScrollTop.current;
|
||||
lastScrollTop.current = el.scrollTop;
|
||||
const bottom = el.scrollTop + el.clientHeight >= el.scrollHeight - 24;
|
||||
if (bottom !== atBottom) setAtBottom(bottom);
|
||||
// The virtualizer's own corrections only move down, only the user scrolls up
|
||||
if (bottom) {
|
||||
setAtBottom(true);
|
||||
return;
|
||||
}
|
||||
if (movedUp) setAtBottom(false);
|
||||
};
|
||||
|
||||
const toggle = (id: number) =>
|
||||
|
||||
Reference in new issue
Block a user