()
| 152 | }, [notePath]) |
| 153 | |
| 154 | const triggerPrint = async (): Promise<void> => { |
| 155 | if (didTriggerPrint.current) return |
| 156 | didTriggerPrint.current = true |
| 157 | try { |
| 158 | if ('fonts' in document && document.fonts?.ready) { |
| 159 | await document.fonts.ready |
| 160 | } |
| 161 | } catch { |
| 162 | // Ignore font readiness failures and continue to print. |
| 163 | } |
| 164 | requestAnimationFrame(() => { |
| 165 | requestAnimationFrame(() => { |
| 166 | window.print() |
| 167 | }) |
| 168 | }) |
| 169 | } |
| 170 | |
| 171 | if (error) { |
| 172 | return ( |