File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
frappe_gmail_thread/public/js Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ 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 (
12+ frm . timeline &&
13+ frm . timeline . doc_info &&
14+ frm . timeline . doc_info . additional_timeline_content
15+ ) {
1216 let gthread_users = new Set ( ) ;
1317 for ( let activity of frm . timeline . doc_info . additional_timeline_content ) {
1418 if ( activity . doctype === "Gmail Thread" ) {
@@ -27,12 +31,15 @@ function page_changed(event) {
2731 const user_info = r . message ;
2832 if ( $ . isEmptyObject ( user_info ) ) return ;
2933 frappe . update_user_info ( user_info ) ;
30- frm . timeline . refresh ( ) ;
34+ if ( frm . timeline ) {
35+ frm . timeline . refresh ( ) ;
36+ }
3137 } ) ;
3238 }
3339 frappe . realtime . on ( "gthread_new_email" , function ( data ) {
34- console . log ( "Received new email" ) ;
35- frm . timeline . refresh ( ) ;
40+ if ( frm . timeline ) {
41+ frm . timeline . refresh ( ) ;
42+ }
3643 } ) ;
3744 } ,
3845 } ) ;
You can’t perform that action at this time.
0 commit comments