Skip to content

Commit

Permalink
Fix interface saving and empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Sep 13, 2023
1 parent a7a7da8 commit f7ce052
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Search } from "../../../Search.js";
import { Modal } from "../../../Modal";
import { List } from "../../../List";

const defaultEmptyMessage = "No interfaces selected"

export class GuidedStructurePage extends Page {
constructor(...args) {
super(...args);
Expand All @@ -32,7 +34,8 @@ export class GuidedStructurePage extends Page {
});

list = new List({
emptyMessage: "No interfaces selected",
emptyMessage: defaultEmptyMessage,
onChange: () => this.unsavedUpdates = true
});

addButton = new Button();
Expand Down Expand Up @@ -77,7 +80,7 @@ export class GuidedStructurePage extends Page {
async updated() {
const { interfaces = {} } = this.info.globalState;

if (Object.keys(interfaces).length > 0) this.list.emptyMessage = "Loading valid interfaces...";
this.list.emptyMessage = "Loading valid interfaces...";

this.search.options = await fetch(`${baseUrl}/neuroconv`)
.then((res) => res.json())
Expand All @@ -93,6 +96,8 @@ export class GuidedStructurePage extends Page {
)
.catch((e) => console.error(e));

this.list.emptyMessage = defaultEmptyMessage

for (const [key, name] of Object.entries(interfaces)) {
let found = this.search.options?.find((o) => o.value === name);

Expand Down

0 comments on commit f7ce052

Please sign in to comment.