Добавление треков неаторизованным пользователям. Убран лишний код
This commit is contained in:
@@ -146,10 +146,18 @@
|
||||
<MudImage Src="@FormatCoverUrl(context.CoverUri, "50x50")" Height="50" Width="50" Class="rounded" />
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>@context.Title</MudTd>
|
||||
<MudTd>
|
||||
<MudLink Href="@($"https://music.yandex.ru/track/{context.Id}")"
|
||||
Target="_blank"
|
||||
Underline="Underline.Hover"
|
||||
Style="cursor: pointer; display: inline-flex; align-items: center;">
|
||||
@context.Title
|
||||
<MudIcon Icon="@Icons.Material.Filled.OpenInNew" Size="Size.Small" Class="ml-1" />
|
||||
</MudLink>
|
||||
</MudTd>
|
||||
<MudTd>@string.Join(", ", context.Artists)</MudTd>
|
||||
<MudTd>@FormatDuration(context.DurationMs)</MudTd>
|
||||
@if (_isAuthenticated && _canRemove)
|
||||
@if (_canRemove)
|
||||
{
|
||||
<MudTd>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete" Color="Color.Error" OnClick="() => RemoveTrack(context)" />
|
||||
@@ -274,11 +282,6 @@
|
||||
|
||||
private async Task AddTrack()
|
||||
{
|
||||
if (!_isAuthenticated)
|
||||
{
|
||||
Snackbar.Add("Для добавления треков необходимо войти", Severity.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(_trackLink))
|
||||
{
|
||||
Snackbar.Add("Введите ссылку на трек", Severity.Warning);
|
||||
@@ -314,12 +317,6 @@
|
||||
|
||||
private async Task RemoveTrack(YandexTrackDisplay track)
|
||||
{
|
||||
if (!_isAuthenticated)
|
||||
{
|
||||
Snackbar.Add("Для удаления треков необходимо войти", Severity.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var confirmed = await DialogService.ShowMessageBoxAsync(
|
||||
"Подтверждение удаления",
|
||||
$"Вы уверены, что хотите удалить трек \"{track.Title}\"?",
|
||||
|
||||
Reference in New Issue
Block a user