Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 1, 2023
1 parent 0dbd14f commit d1c19cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/renderer/src/stories/JSONSchemaInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export class JSONSchemaInput extends LitElement {
// onValidate = () => {}

updateData(value, forceValidation = false) {

if (this.value === value && !forceValidation) return false;

const { path: fullPath } = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ export class GuidedPathExpansionPage extends Page {

if (!sesRef) delete globalResults[sub][ses]; // Delete removed sessions
else {

const globalSesRef = globalResults[sub][ses]
const globalSesRef = globalResults[sub][ses];

for (let name in globalSesRef.source_data) {
if (!sesRef.source_data[name]) delete globalSesRef.source_data[name]; // Delete removed interfaces
Expand Down Expand Up @@ -258,7 +257,10 @@ export class GuidedPathExpansionPage extends Page {
// altContent: this.altForm,
});

const structureState = (this.localState = merge(this.info.globalState.structure, { results: {}, keep_existing_data: true }));
const structureState = (this.localState = merge(this.info.globalState.structure, {
results: {},
keep_existing_data: true,
}));

const state = structureState.state;

Expand All @@ -280,12 +282,11 @@ export class GuidedPathExpansionPage extends Page {

// NOTE: These are custom coupled form inputs
onUpdate: (path, value) => {

this.unsavedUpdates = true
this.unsavedUpdates = true;

const parentPath = [...path]
const parentPath = [...path];
const name = parentPath.pop();

if (name === "base_directory") {
form.getInput([...parentPath, "base_directory"]).value = value; // Update value pre-emptively
const input = form.getInput([...parentPath, "format_string_path"]);
Expand All @@ -296,19 +297,17 @@ export class GuidedPathExpansionPage extends Page {
const value = parent[name];

if (fs) {
const baseDir = form.getInput([...parentPath, "base_directory"])
if (name === "format_string_path") {

const baseDir = form.getInput([...parentPath, "base_directory"]);
if (name === "format_string_path") {
if (value && !baseDir.value) {
return [
{
message: html`A base directory must be provided to locate your files.`,
type: "error",
},
]
];
}


const base_directory = [...parentPath, "base_directory"].reduce(
(acc, key) => acc[key],
this.form.resolved
Expand Down

0 comments on commit d1c19cd

Please sign in to comment.