[frontend/core] Add note search state pattern
This commit is contained in:
parent
e4074dddbc
commit
bc335b8f2c
2 changed files with 26 additions and 0 deletions
|
@ -7,4 +7,5 @@ internal class StateService(MessageService messageService)
|
|||
public VirtualScroller VirtualScroller { get; } = new(messageService);
|
||||
public Timeline Timeline { get; } = new(messageService);
|
||||
public SingleNote SingleNote { get; } = new();
|
||||
public Search Search { get; } = new();
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
using Iceshrimp.Shared.Schemas.Web;
|
||||
|
||||
namespace Iceshrimp.Frontend.Core.Services.StateServicePatterns;
|
||||
|
||||
internal class Search
|
||||
{
|
||||
private SearchState? State { get; set; }
|
||||
|
||||
public SearchState? GetState()
|
||||
{
|
||||
return State;
|
||||
}
|
||||
|
||||
public void SetState(SearchState newState)
|
||||
{
|
||||
State = newState;
|
||||
}
|
||||
}
|
||||
|
||||
internal class SearchState
|
||||
{
|
||||
public required List<NoteResponse> SearchResults;
|
||||
public required float ScrollTop = 0;
|
||||
public required string SearchString;
|
||||
}
|
Loading…
Add table
Reference in a new issue