mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	fix: 🐛 fix crash when no calendarRoot
This commit is contained in:
		
							parent
							
								
									a4f59030e3
								
							
						
					
					
						commit
						f346c40b7c
					
				@ -213,6 +213,10 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private async getWeekNoteEnable() {
 | 
					    private async getWeekNoteEnable() {
 | 
				
			||||||
        const noteId = await server.get<string[]>(`search/${encodeURIComponent('#calendarRoot')}`);
 | 
					        const noteId = await server.get<string[]>(`search/${encodeURIComponent('#calendarRoot')}`);
 | 
				
			||||||
 | 
					        if (noteId.length === 0) {
 | 
				
			||||||
 | 
					            this.weekNoteEnable = false;
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        const noteAttributes = await server.get<BAttribute[]>(`notes/${noteId}/attributes`);
 | 
					        const noteAttributes = await server.get<BAttribute[]>(`notes/${noteId}/attributes`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (const attribute of noteAttributes) {
 | 
					        for (const attribute of noteAttributes) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user