Skip to content

Commit

Permalink
hide footer in chat again
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Aug 18, 2024
1 parent 3b6899a commit d6ff7d5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/web/Jordnaer/Pages/Chat/ChatPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@inject IBrowserViewportService BrowserViewportService
@inject ChatSignalRClient ChatSignalRClient
@inject NavigationManager Navigation
@inject IJSRuntime JsRuntime

@implements IAsyncDisposable

Expand Down Expand Up @@ -61,7 +62,15 @@
return;
}

await BrowserViewportService.SubscribeAsync(
List<Task> tasks = [];

if (_isMobile)
{
var hideElementTask = JsRuntime.HideElement(".footer");
tasks.Add(hideElementTask);
}

var subscribeToViewportChangesTask = BrowserViewportService.SubscribeAsync(
observerId: _breakpointObserverId,
lambda: async args =>
{
Expand All @@ -73,7 +82,9 @@
}
},
fireImmediately: true);
tasks.Add(subscribeToViewportChangesTask);

await Task.WhenAll(tasks);
}

protected override async Task OnInitializedAsync()
Expand All @@ -97,7 +108,7 @@
}

await StartSignalR();

_isLoading = false;
}

Expand Down

0 comments on commit d6ff7d5

Please sign in to comment.