Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-Load JSON File For Dev? #178

Open
aronduby opened this issue Nov 8, 2024 · 0 comments
Open

Auto-Load JSON File For Dev? #178

aronduby opened this issue Nov 8, 2024 · 0 comments

Comments

@aronduby
Copy link

aronduby commented Nov 8, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant