Skip to content

Auto-Load JSON File For Dev? #178

@aronduby

Description

@aronduby

I'm attempting to make some tweaks to the UI in the View Report section and those tweaks require report data, but when the hot reload happens it loses the report data and I get into a loop about "changes might not be saved" and then I have to go back and re-open the report. I've not been able to figure out a way to have that auto-load that content.

The closest I've managed to get is adding the following to App.svelte

function loadOurDefault() {
    $evaluationStore
      .open(ecaData);
}

loadOurDefault();

But that resulted in the following error and the app not loading.

Error: [svelte-i18n] Cannot format a message without first setting the initial locale.

I tried tweaking further and ended up with this, which seems to wait till it loads, but then nothing actually shows in the report.

async function loadOurDefault() {
    await waitLocale();
    
    $evaluationStore
      .open(ecaData)
      .then(() => {
        $interactedOpenEvaluation = true;
        $interacted = true;
      });
  }

Is there a way to pull this off?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions