2024-05-30 01:06:08 +00:00
|
|
|
@inherits LayoutComponentBase
|
2024-06-14 07:20:04 +00:00
|
|
|
@implements IDisposable
|
2024-06-01 04:38:12 +00:00
|
|
|
@inject NavigatorService NavigatorService
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
@inject State State
|
2024-05-31 01:27:01 +00:00
|
|
|
<NavMenu />
|
|
|
|
<main class="responsive max">
|
|
|
|
@Body
|
|
|
|
</main>
|
2024-06-01 04:38:12 +00:00
|
|
|
|
|
|
|
@code {
|
|
|
|
protected override void OnInitialized() {
|
|
|
|
base.OnInitialized();
|
|
|
|
NavigatorService.NavigationManager = NavigationManager;
|
2024-06-14 07:20:04 +00:00
|
|
|
State.IntentReceived += IntentRecieved;
|
|
|
|
if (!string.IsNullOrEmpty(State.ShareString) || !string.IsNullOrEmpty(State.SharePhoto)) {
|
|
|
|
IntentRecieved();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void IntentRecieved(object? sender = null, EventArgs? e = null) {
|
|
|
|
if (!string.IsNullOrEmpty(State.ShareString)) {
|
|
|
|
NavigationManager.NavigateTo($"/sharetext/{State.ShareString}");
|
|
|
|
State.ShareString = null;
|
|
|
|
}
|
|
|
|
else if (!string.IsNullOrEmpty(State.SharePhoto)) {
|
|
|
|
NavigationManager.NavigateTo($"/sharepic/{State.SharePhoto}");
|
|
|
|
State.ShareString = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IDisposable.Dispose() {
|
|
|
|
State.IntentReceived -= IntentRecieved;
|
2024-06-01 04:38:12 +00:00
|
|
|
}
|
|
|
|
}
|