Refactor NotificationsClient (#270)

This commit is contained in:
Steve Faulkner
2020-10-12 22:10:28 -05:00
committed by GitHub
parent 3b64d75322
commit cfb9a0b321
28 changed files with 75 additions and 157 deletions

View File

@@ -40,6 +40,7 @@ import { configContext } from "../../ConfigContext";
import Explorer from "../Explorer";
import { userContext } from "../../UserContext";
import TabsBase from "../Tabs/TabsBase";
import { fetchPortalNotifications } from "../../Common/PortalNotifications";
export default class Collection implements ViewModels.Collection {
public nodeKind: string;
@@ -1213,7 +1214,7 @@ export default class Collection implements ViewModels.Collection {
}
const deferred: Q.Deferred<DataModels.Notification> = Q.defer<DataModels.Notification>();
this.container.notificationsClient.fetchNotifications().then(
fetchPortalNotifications().then(
(notifications: DataModels.Notification[]) => {
if (!notifications || notifications.length === 0) {
deferred.resolve(undefined);

View File

@@ -15,6 +15,7 @@ import Explorer from "../Explorer";
import { readCollections } from "../../Common/dataAccess/readCollections";
import { readDatabaseOffer } from "../../Common/dataAccess/readDatabaseOffer";
import { DefaultAccountExperienceType } from "../../DefaultAccountExperienceType";
import { fetchPortalNotifications } from "../../Common/PortalNotifications";
export default class Database implements ViewModels.Database {
public nodeKind: string;
@@ -220,8 +221,8 @@ export default class Database implements ViewModels.Database {
}
const deferred: Q.Deferred<DataModels.Notification> = Q.defer<DataModels.Notification>();
this.container.notificationsClient.fetchNotifications().then(
(notifications: DataModels.Notification[]) => {
fetchPortalNotifications().then(
notifications => {
if (!notifications || notifications.length === 0) {
deferred.resolve(undefined);
return;