This repository was archived by the owner on Jun 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 1
1
import Component from "../components/component.js" ;
2
-
2
+ import { t } from "../services/i18n.js" ;
3
+ import toastService from "../services/toast.js" ;
3
4
4
5
/**
5
6
* This is the base widget for all other widgets.
@@ -81,7 +82,18 @@ class BasicWidget extends Component {
81
82
}
82
83
83
84
render ( ) {
84
- this . doRender ( ) ;
85
+ try {
86
+ this . doRender ( ) ;
87
+ } catch ( e ) {
88
+ toastService . showPersistent ( {
89
+ title : t ( "toast.widget-error.title" ) ,
90
+ icon : "alert" ,
91
+ message : t ( "toast.widget-error.message" , {
92
+ title : this . widgetTitle ,
93
+ message : e . message
94
+ } )
95
+ } ) ;
96
+ }
85
97
86
98
this . $widget . attr ( 'data-component-id' , this . componentId ) ;
87
99
this . $widget
Original file line number Diff line number Diff line change 1
1
import NoteContextAwareWidget from "./note_context_aware_widget.js" ;
2
- import toastService from "../services/toast.js" ;
3
- import { t } from "../services/i18n.js" ;
4
2
5
3
const WIDGET_TPL = `
6
4
<div class="card widget">
@@ -56,19 +54,7 @@ class RightPanelWidget extends NoteContextAwareWidget {
56
54
this . $buttons . append ( buttonWidget . render ( ) ) ;
57
55
}
58
56
59
- try {
60
- this . initialized = this . doRenderBody ( ) ;
61
- } catch ( e ) {
62
- toastService . showPersistent ( {
63
- title : t ( "toast.widget-error.title" ) ,
64
- icon : "alert" ,
65
- message : t ( "toast.widget-error.message" , {
66
- title : this . widgetTitle ,
67
- message : e . message
68
- } )
69
- } ) ;
70
- logError ( e ) ;
71
- }
57
+ this . initialized = this . doRenderBody ( ) ;
72
58
}
73
59
74
60
/**
You can’t perform that action at this time.
0 commit comments