Refresh the pages on content creation

This commit is contained in:
Elio Struyf
2021-12-17 19:21:59 +01:00
parent e576b6e8a4
commit af9865d91b
3 changed files with 12 additions and 0 deletions
+4
View File
@@ -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();
}
/**
+4
View File
@@ -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();
}
}
+4
View File
@@ -124,4 +124,8 @@ export class PagesListener extends BaseListener {
this.sendMsg(DashboardCommand.pages, pages);
}
public static refresh() {
this.getPagesData();
}
}