Skip to content

Commit

Permalink
Fix access choice chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Mar 29, 2024
1 parent 23bb8fe commit 0785cd0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/model/Project/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Project extends Folder {
}
}
public get accessProtocol(): string {
return this.properties.getTextStringOrEmpty("configurationName");
return this.properties.getTextStringOrEmpty("archiveConfigurationName");
}
public static fromDirectory(directory: string): Project {
try {
Expand Down Expand Up @@ -479,7 +479,7 @@ export class Project extends Folder {

private setupProtocolChoices() {
this.authorityLists.setAccessProtocol(
this.properties.getTextStringOrEmpty("configurationName"),
this.properties.getTextStringOrEmpty("archiveConfigurationName"),
this.properties.getTextStringOrEmpty("customAccessChoices")
);

Expand All @@ -488,7 +488,9 @@ export class Project extends Folder {
mobx.reaction(
() => {
return {
protocol: this.properties.getTextStringOrEmpty("configurationName"),
protocol: this.properties.getTextStringOrEmpty(
"archiveConfigurationName"
),
customChoices: this.properties.getTextStringOrEmpty(
"customAccessChoices"
)
Expand All @@ -500,7 +502,7 @@ export class Project extends Folder {
}
);
mobx.reaction(
() => this.properties.getValueOrThrow("configurationName").text,
() => this.properties.getValueOrThrow("archiveConfigurationName").text,
(newValue) =>
// .textHolder.map.intercept((change) => { mobx6 doesn't have this intercept
this.authorityLists.setAccessProtocol(
Expand All @@ -511,8 +513,9 @@ export class Project extends Folder {
mobx.reaction(
() => this.properties.getValueOrThrow("customAccessChoices").text,
(newValue) => {
const currentProtocol =
this.properties.getTextStringOrEmpty("configurationName");
const currentProtocol = this.properties.getTextStringOrEmpty(
"archiveConfigurationName"
);
// a problem with this is that it's going going get called for every keystroke in the Custom Access Choices box
this.authorityLists.setAccessProtocol(currentProtocol, newValue);
}
Expand All @@ -521,7 +524,7 @@ export class Project extends Folder {
// .getValueOrThrow("customAccessChoices")
// .textHolder.map.intercept((change) => {
// const currentProtocol = this.properties.getTextStringOrEmpty(
// "configurationName"
// "archiveConfigurationName"
// );
// // a problem with this is that it's going going get called for every keystrock in the Custom Access Choices box
// this.authorityLists.setAccessProtocol(
Expand Down

0 comments on commit 0785cd0

Please sign in to comment.