mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 21:04:21 +01:00
Fixed guide item expansion.
This commit is contained in:
parent
65a964b7ee
commit
bd4d465089
|
@ -119,7 +119,7 @@ namespace SharpRss.Services
|
|||
feeds.Add(new FeedModel(reader["url"].ToString())
|
||||
{
|
||||
Id = reader["id"].ToString(),
|
||||
Title = reader["group_id"].ToString(),
|
||||
Title = reader["title"].ToString(),
|
||||
GroupId = reader["group_id"].ToString(),
|
||||
FeedType = reader["feed_type"].ToString(),
|
||||
Description = reader["description"].ToString(),
|
||||
|
@ -139,7 +139,7 @@ namespace SharpRss.Services
|
|||
{
|
||||
bool result = false;
|
||||
_sqlConn.Open();
|
||||
using SqliteCommand cmd = new SqliteCommand($"INSERT OR REPLACE INTO {_feedTable} (id, url, title, group_id, feed_type, description, language, copyright, date_added, last_updated, image_url, original_document) VALUES (IFNULL((SELECT id FROM {_feedTable} WHERE url=@url), @id), @url, @title, @groupId, @feedType, @description, @language, @copyright, @dateAdded, @lastUpdated, @imageUrl, @originalDoc)", _sqlConn)
|
||||
using SqliteCommand cmd = new SqliteCommand($"INSERT OR REPLACE INTO {_feedTable} (id, url, title, group_id, feed_type, description, language, copyright, date_added, last_updated, image_url, original_document) VALUES (IFNULL((SELECT id FROM {_feedTable} WHERE url=@url), @id), @url, @title, @groupId, @feedType, @description, @language, @copyright, IFNULL((SELECT date_added FROM {_feedItemTable} WHERE id=@id), @dateAdded), @lastUpdated, @imageUrl, @originalDoc)", _sqlConn)
|
||||
{
|
||||
Parameters =
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<Content>
|
||||
<div style="display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%">
|
||||
<div style="justify-self: start;" class="d-flex align-center">
|
||||
<MudTreeViewItemToggleButton @bind-Expanded="@context.IsExpanded" Loading="@context.Loading" Visible="@context.HasChild" LoadingIconColor="Color.Info" />
|
||||
<MudTreeViewItemToggleButton ExpandedChanged="@(() => ExpandedChanged(context))" Loading="@context.Loading" Visible="@context.HasChild" LoadingIconColor="Color.Info" />
|
||||
@if (context.FaviconUrl == null && context.Icon != null)
|
||||
{
|
||||
<MudIcon Icon="@context.Icon" Style="@($"color:{context.GroupModel?.HexColor ?? Theme.Palette.Primary.Value}")"/>
|
||||
|
@ -54,13 +54,15 @@
|
|||
{
|
||||
|
||||
}
|
||||
//private async void ExpandedClicked(TreeItemData treeItemData)
|
||||
//{
|
||||
// treeItemData.Loading = true;
|
||||
// var groupedItems = await _rssService.GetFeedsAsync(treeItemData.GroupModel);
|
||||
// treeItemData.Children = ModelToTreeItem(groupedItems);
|
||||
// treeItemData.Loading = false;
|
||||
//}
|
||||
private async void ExpandedChanged(TreeItemData treeItemData)
|
||||
{
|
||||
treeItemData.Loading = true;
|
||||
var groupedItems = await _rssService.GetFeedsAsync(treeItemData.GroupModel);
|
||||
treeItemData.Children = ModelToTreeItem(groupedItems);
|
||||
treeItemData.IsExpanded = !treeItemData.IsExpanded;
|
||||
treeItemData.Loading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
Log.Verbose("Loading guide data...");
|
||||
|
|
Loading…
Reference in New Issue
Block a user