File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
frappe_gmail_thread/public/js Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ function page_changed(event) {
88 if ( route [ 0 ] == "Form" ) {
99 frappe . ui . form . on ( route [ 1 ] , {
1010 refresh : function ( frm ) {
11- if ( frm . timeline . doc_info . additional_timeline_content ) {
11+ if ( frm . timeline && frm . timeline . doc_info && frm . timeline . doc_info . additional_timeline_content ) {
1212 let gthread_users = new Set ( ) ;
1313 for ( let activity of frm . timeline . doc_info . additional_timeline_content ) {
1414 if ( activity . doctype === "Gmail Thread" ) {
@@ -27,12 +27,15 @@ function page_changed(event) {
2727 const user_info = r . message ;
2828 if ( $ . isEmptyObject ( user_info ) ) return ;
2929 frappe . update_user_info ( user_info ) ;
30- frm . timeline . refresh ( ) ;
30+ if ( frm . timeline ) {
31+ frm . timeline . refresh ( ) ;
32+ }
3133 } ) ;
3234 }
3335 frappe . realtime . on ( "gthread_new_email" , function ( data ) {
34- console . log ( "Received new email" ) ;
35- frm . timeline . refresh ( ) ;
36+ if ( frm . timeline ) {
37+ frm . timeline . refresh ( ) ;
38+ }
3639 } ) ;
3740 } ,
3841 } ) ;
You can’t perform that action at this time.
0 commit comments