Skip to content

Commit

Permalink
Updated to support URLs again.
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferStrube committed Jun 5, 2024
1 parent f1e205e commit 759fcad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
{
AudioContext = await AudioContext.CreateAsync(JSRuntime);

await InvokeAsync(StateHasChanged);
await ProcessQueue();
StateHasChanged();

while (running)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,30 @@

<textarea @bind="Input" @bind:event="oninput" style="width:100%;height:10vh;" @bind:after=AudioEditor.StopAsync />

<div style="height:70vh;">
<AudioEditor @ref=AudioEditor @bind-Input="Input" />
</div>
@if (Code is null)
{
<div style="height:70vh;">
<AudioEditor @ref=AudioEditor @bind-Input="Input" />
</div>
}
else
{
<div style="height:70vh;display:flex;align-items:center;justify-content:center;">
<button class="btn btn-lg btn-success" @onclick="() => Code = null">Initialize from URL</button>
</div>
}

@code {
AudioEditor AudioEditor = default!;

[Parameter, SupplyParameterFromQuery(Name = "input")]
[Parameter, SupplyParameterFromQuery(Name = "code")]
public string? Code { get; set; }

public string? Input { get; set; }

protected override void OnInitialized()
{
Input ??= Code;
Input ??= "";
}

Expand Down

0 comments on commit 759fcad

Please sign in to comment.