mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	client: Stop crash if right widget crashes during render
This commit is contained in:
		
							parent
							
								
									43ef452d44
								
							
						
					
					
						commit
						48b0af1bba
					
				| @ -1,4 +1,6 @@ | |||||||
| import NoteContextAwareWidget from "./note_context_aware_widget.js"; | import NoteContextAwareWidget from "./note_context_aware_widget.js"; | ||||||
|  | import toastService from "../services/toast.js"; | ||||||
|  | import { t } from "../services/i18n.js"; | ||||||
| 
 | 
 | ||||||
| const WIDGET_TPL = ` | const WIDGET_TPL = ` | ||||||
| <div class="card widget"> | <div class="card widget"> | ||||||
| @ -54,7 +56,16 @@ class RightPanelWidget extends NoteContextAwareWidget { | |||||||
|             this.$buttons.append(buttonWidget.render()); |             this.$buttons.append(buttonWidget.render()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.initialized = this.doRenderBody(); |         this.initialized = this.doRenderBody().catch(e => { | ||||||
|  |             toastService.showPersistent({ | ||||||
|  |                 title: t("toast.widget-error.title"), | ||||||
|  |                 icon: "alert", | ||||||
|  |                 message: t("toast.widget-error.message", { | ||||||
|  |                     title: this.widgetTitle, | ||||||
|  |                     message: e.message | ||||||
|  |                 }) | ||||||
|  |             }); | ||||||
|  |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran