fix(desktop): address code-review findings on the desktop wave
- fileEntries: a single unreadable file/dir in a dropped folder no longer aborts the whole traversal (try/catch per entry, skip failures) — was discarding ALL dropped files (incl. the flat-file path) + an unhandled rejection; also add .catch in both useFileDrop consumers. - RoomInput: mirror a localStorage-restored draft into the draft atom so the P5-57 indicator reflects a persisted draft after a page reload, not only on same-session room re-entry. - useTauriThumbbar: swallow toggleMicrophone()/hangup() rejections (parity with SMTC) — avoids an unhandled rejection when clicked mid-teardown. - App/DesktopChrome: keep wrapper element types stable across the chrome toggle (display:contents when off) so flipping it no longer remounts RouterProvider. - settings: normalizeComposerToolbarOrder also appends missing keys from the canonical key set (safety net if a new button is absent from the default order). Gates: tsc/eslint/prettier clean, build OK, 559 tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -6,9 +6,11 @@ export const useFileDropHandler = (onDrop: (file: File[]) => void): DragEventHan
|
||||
(evt) => {
|
||||
// `collectDroppedFiles` synchronously captures the entry list from the
|
||||
// DataTransfer before traversing folders asynchronously.
|
||||
collectDroppedFiles(evt.dataTransfer).then((files) => {
|
||||
if (files) onDrop(files);
|
||||
});
|
||||
collectDroppedFiles(evt.dataTransfer)
|
||||
.then((files) => {
|
||||
if (files) onDrop(files);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
},
|
||||
[onDrop],
|
||||
);
|
||||
@@ -30,9 +32,11 @@ export const useFileDropZone = (
|
||||
// Capture entries synchronously (inside the event) then traverse any
|
||||
// dropped folders asynchronously — the DataTransferItemList is emptied
|
||||
// once this handler returns.
|
||||
collectDroppedFiles(evt.dataTransfer).then((files) => {
|
||||
if (files) onDrop(files);
|
||||
});
|
||||
collectDroppedFiles(evt.dataTransfer)
|
||||
.then((files) => {
|
||||
if (files) onDrop(files);
|
||||
})
|
||||
.catch(() => undefined);
|
||||
};
|
||||
|
||||
target?.addEventListener('drop', handleDrop);
|
||||
|
||||
@@ -31,13 +31,14 @@ export function useTauriThumbbar(): void {
|
||||
if (!callEmbed) return;
|
||||
if (action === 'mute') {
|
||||
// toggleMicrophone flips the mic; `microphone === false` means muted.
|
||||
callEmbed.control.toggleMicrophone();
|
||||
// Async transport send — swallow rejection (widget mid-teardown), as SMTC does.
|
||||
callEmbed.control.toggleMicrophone().catch(() => undefined);
|
||||
} else if (action === 'deafen') {
|
||||
// toggleSound flips local audio; `sound === false` means deafened. It also
|
||||
// mutes the mic while deafened, matching the in-app Deafen control.
|
||||
callEmbed.control.toggleSound();
|
||||
} else if (action === 'end') {
|
||||
callEmbed.hangup();
|
||||
callEmbed.hangup().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user