chore(react/ribbon): fix some more crashes when rapidly switching tabs

This commit is contained in:
Elian Doran
2025-08-24 20:31:39 +03:00
parent 1e9b772692
commit 7c86f90ac6
3 changed files with 3 additions and 3 deletions

View File

@@ -544,7 +544,7 @@ export function useWindowSize() {
window.addEventListener("resize", onResize); window.addEventListener("resize", onResize);
return () => window.removeEventListener("resize", onResize); return () => window.removeEventListener("resize", onResize);
}); }, []);
return size; return size;
} }

View File

@@ -27,7 +27,7 @@ export default function EditedNotesTab({ note }: TabContext) {
width: "100%", width: "100%",
overflow: "auto" overflow: "auto"
}}> }}>
{editedNotes ? ( {editedNotes?.length ? (
<div className="edited-notes-list use-tn-links"> <div className="edited-notes-list use-tn-links">
{joinElements(editedNotes.map(editedNote => { {joinElements(editedNotes.map(editedNote => {
return ( return (

View File

@@ -29,7 +29,7 @@ export default function NotePathsTab({ note, hoistedNoteId, notePath }: TabConte
return ( return (
<div class="note-paths-widget"> <div class="note-paths-widget">
{sortedNotePaths && ( {sortedNotePaths?.length && (
<> <>
<div className="note-path-intro"> <div className="note-path-intro">
{sortedNotePaths.length > 0 ? t("note_paths.intro_placed") : t("note_paths.intro_not_placed")} {sortedNotePaths.length > 0 ? t("note_paths.intro_placed") : t("note_paths.intro_not_placed")}