@@ -35,9 +35,11 @@ import {
3535 WorkspaceLeaf ,
3636 TFile ,
3737 Menu ,
38+ Notice ,
3839} from "obsidian" ;
3940import { createRoot , Root } from "react-dom/client" ;
4041import DatabaseInfo from "services/DatabaseInfo" ;
42+ import { DataviewService } from "services/DataviewService" ;
4143import { LOGGER } from "services/Logger" ;
4244import { SettingsModal } from "Settings" ;
4345import StateManager from "StateManager" ;
@@ -145,6 +147,7 @@ export class DatabaseView extends TextFileView implements HoverParent {
145147 async initDatabase ( ) : Promise < void > {
146148 try {
147149 LOGGER . info ( `=>initDatabase ${ this . file . path } ` ) ;
150+ this . checkRequiredLibraries ( ) ;
148151 // Load the database file
149152 this . diskConfig = new DatabaseInfo ( this . file ) ;
150153 await this . diskConfig . initDatabaseconfigYaml (
@@ -347,4 +350,15 @@ export class DatabaseView extends TextFileView implements HoverParent {
347350 openFilters ( ) {
348351 this . emitter . emit ( EMITTERS_GROUPS . SHORTCUT , EMITTERS_SHORTCUT . OPEN_FILTERS ) ;
349352 }
353+ /****************************************************************
354+ * VIEW VALIDATIONS
355+ * **************************************************************/
356+ private checkRequiredLibraries ( ) : void {
357+ if ( ! DataviewService . indexIsLoaded ) {
358+ new Notice (
359+ `Dataview plugin is not loaded yet. Please wait a few seconds and refresh the page.` ,
360+ 1000
361+ ) ;
362+ }
363+ }
350364}
0 commit comments