mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-06-19 09:35:42 +02:00
Refresh the pages on content creation
This commit is contained in:
@@ -11,6 +11,7 @@ import { Project } from './Project';
|
||||
import { Folders } from './Folders';
|
||||
import { ContentType } from '../helpers/ContentType';
|
||||
import { ContentType as IContentType } from '../models';
|
||||
import { PagesListener } from '../listeners';
|
||||
|
||||
export class Template {
|
||||
|
||||
@@ -176,6 +177,9 @@ export class Template {
|
||||
}
|
||||
|
||||
Notifications.info(`Your new content has been created.`);
|
||||
|
||||
// Trigger a refresh for the dashboard
|
||||
PagesListener.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { PagesListener } from './../listeners/PagesListener';
|
||||
import { ArticleHelper, Settings } from ".";
|
||||
import { SETTINGS_CONTENT_DRAFT_FIELD, SETTING_TAXONOMY_CONTENT_TYPES } from "../constants";
|
||||
import { ContentType as IContentType, DraftField } from '../models';
|
||||
@@ -128,5 +129,8 @@ export class ContentType {
|
||||
}
|
||||
|
||||
Notifications.info(`Your new content has been created.`);
|
||||
|
||||
// Trigger a refresh for the dashboard
|
||||
PagesListener.refresh();
|
||||
}
|
||||
}
|
||||
@@ -124,4 +124,8 @@ export class PagesListener extends BaseListener {
|
||||
|
||||
this.sendMsg(DashboardCommand.pages, pages);
|
||||
}
|
||||
|
||||
public static refresh() {
|
||||
this.getPagesData();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user