aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Main.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r--src/client/views/Main.tsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index fd2e23c91..32798631d 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -348,10 +348,10 @@ export class Main extends React.Component {
// --------------- Northstar hooks ------------- /
- @action SetNorthstarCatalog(ctlog: Catalog) {
- CurrentUserUtils.NorthstarDBCatalog = ctlog;
+ @action AddToNorthstarCatalog(ctlog: Catalog) {
+ CurrentUserUtils.NorthstarDBCatalog = CurrentUserUtils.NorthstarDBCatalog ? CurrentUserUtils.NorthstarDBCatalog : ctlog;
if (ctlog && ctlog.schemas) {
- this._northstarSchemas = ctlog.schemas.map(schema => {
+ this._northstarSchemas.push(...ctlog.schemas.map(schema => {
let schemaDoc = Documents.TreeDocument([], { width: 50, height: 100, title: schema.displayName! });
let schemaDocuments = schemaDoc.GetList(KeyStore.Data, [] as Document[]);
CurrentUserUtils.GetAllNorthstarColumnAttributes(schema).map(attr => {
@@ -369,7 +369,7 @@ export class Main extends React.Component {
}));
});
return schemaDoc;
- });
+ }));
}
}
async initializeNorthstar(): Promise<void> {
@@ -382,7 +382,12 @@ export class Main extends React.Component {
const env = await response.json();
Settings.Instance.Update(env);
let cat = Gateway.Instance.ClearCatalog();
- cat.then(async () => this.SetNorthstarCatalog(await Gateway.Instance.GetCatalog()));
+ cat.then(async () => {
+ this.AddToNorthstarCatalog(await Gateway.Instance.GetCatalog());
+ if (!CurrentUserUtils.GetNorthstarSchema("Book1"))
+ this.AddToNorthstarCatalog(await Gateway.Instance.GetSchema("http://www.cs.brown.edu/~bcz/Book1.csv"));
+ });
+
}
}