Skip to content

Commit

Permalink
Fix how we handle fetching a project on the view page (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony authored Dec 20, 2024
1 parent 595134e commit 4d5a0d3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Angor/Client/Pages/View.razor
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,14 @@ else
{
project = new Project { CreationTransactionId = projectIndexerData.TrxId };

_RelayService.LookupProjectsInfoByEventIds<NostrEvent>(x =>
_RelayService.LookupProjectsInfoByEventIds<ProjectInfo>(projectInfo =>
{
if (project is { ProjectInfo : null })
project.ProjectInfo = serializer.Deserialize<ProjectInfo>(x.Content!) ??
throw new Exception("The project info must be in the application specific data event");
if (projectInfo is null)
{
throw new Exception("The project info must be in the application specific data event");
}

if (project is { ProjectInfo : null }) { project.ProjectInfo = projectInfo; }
},
() =>
{
Expand All @@ -539,7 +542,10 @@ else
findInProgress = false;
if (project?.ProjectInfo != null)
{
SessionStorage.StoreProject(project);
if (!SessionStorage.IsProjectInStorageById(project.ProjectInfo.ProjectIdentifier))
{
SessionStorage.StoreProject(project);
}
}
else
{
Expand Down

0 comments on commit 4d5a0d3

Please sign in to comment.