mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-12 02:31:51 +00:00
- Application LifeCycle has now started in Main, not ServiceHub.
This commit is contained in:
@@ -78,7 +78,7 @@ export class ModuleInitializerFile extends AbstractModule {
|
||||
const _filesStorage = [] as typeof filesStorageSrc;
|
||||
|
||||
for (const f of filesStorageSrc) {
|
||||
if (await this.services.vault.isTargetFile(f.path, f != filesStorageSrc[0])) {
|
||||
if (await this.services.vault.isTargetFile(f.path)) {
|
||||
_filesStorage.push(f);
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export class ModuleInitializerFile extends AbstractModule {
|
||||
);
|
||||
const path = this.getPath(doc);
|
||||
|
||||
if (isValidPath(path) && (await this.services.vault.isTargetFile(path, true))) {
|
||||
if (isValidPath(path) && (await this.services.vault.isTargetFile(path))) {
|
||||
if (!isMetaEntry(doc)) {
|
||||
this._log(`Invalid entry: ${path}`, LOG_LEVEL_INFO);
|
||||
continue;
|
||||
|
||||
@@ -133,7 +133,7 @@ export class ModuleMigration extends AbstractModule {
|
||||
if (!isValidPath(path)) {
|
||||
continue;
|
||||
}
|
||||
if (!(await this.services.vault.isTargetFile(path, true))) {
|
||||
if (!(await this.services.vault.isTargetFile(path))) {
|
||||
continue;
|
||||
}
|
||||
if (!isMetaEntry(metaDoc)) {
|
||||
|
||||
@@ -69,7 +69,7 @@ export class ModuleObsidianEvents extends AbstractObsidianModule {
|
||||
//@ts-ignore
|
||||
window.CodeMirrorAdapter.commands.save = () => {
|
||||
//@ts-ignore
|
||||
_this.app.commands.executeCommandById("editor:save-file");
|
||||
void _this.app.commands.executeCommandById("editor:save-file");
|
||||
// _this.app.performCommand('editor:save-file');
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,12 +9,6 @@ declare module "obsidian" {
|
||||
}
|
||||
// InjectableAppLifecycleService
|
||||
export class ObsidianAppLifecycleService<T extends ObsidianServiceContext> extends AppLifecycleServiceBase<T> {
|
||||
constructor(context: T) {
|
||||
super(context);
|
||||
// The main entry point when Obsidian's workspace is ready
|
||||
const onReady = this.onReady;
|
||||
this.context.app.workspace.onLayoutReady(onReady);
|
||||
}
|
||||
performRestart(): void {
|
||||
void this.context.plugin.app.commands.executeCommandById("app:reload");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user