@@ -530,19 +530,29 @@ export default function App() {
530530
531531 // Function to calculate totals for a table
532532 const calculateTableTotals = ( tableBlock : Block < DefaultBlockSchema > ) => {
533- if ( tableBlock . type !== "table" ) return ;
533+ if ( tableBlock . type !== "table" ) {
534+ return ;
535+ }
534536
535537 const rows = tableBlock . content . rows ;
536- if ( rows . length < 2 ) return ; // Need at least header + 1 data row
538+ if ( rows . length < 2 ) {
539+ return ;
540+ } // Need at least header + 1 data row
537541
538542 let grandTotal = 0 ;
539543 const updatedRows = rows . map ( ( row , rowIndex : number ) => {
540- if ( rowIndex === 0 ) return row ; // Skip header row
541- if ( rowIndex === rows . length - 1 ) return row ; // Skip grand total row
544+ if ( rowIndex === 0 ) {
545+ return row ;
546+ } // Skip header row
547+ if ( rowIndex === rows . length - 1 ) {
548+ return row ;
549+ } // Skip grand total row
542550
543551 // Helper function to extract text from a cell
544552 const getCellText = ( cell : any ) : string => {
545- if ( typeof cell === "string" ) return cell ;
553+ if ( typeof cell === "string" ) {
554+ return cell ;
555+ }
546556 if ( cell && typeof cell === "object" && "content" in cell ) {
547557 return cell . content ?. [ 0 ] ?. text || "0" ;
548558 }
@@ -649,7 +659,9 @@ export default function App() {
649659 onChange = { ( editor , { getChanges } ) => {
650660 const changes = getChanges ( ) ;
651661
652- if ( changes . length === 0 || applying . current ) return ;
662+ if ( changes . length === 0 || applying . current ) {
663+ return ;
664+ }
653665
654666 // prevents a double onChange because we're updating the block here
655667 applying . current = true ;
0 commit comments