Skip to content

Commit

Permalink
Fix type in diff branch linking
Browse files Browse the repository at this point in the history
  • Loading branch information
hojberg committed Nov 22, 2024
1 parent aeec3d1 commit 05fe843
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/UnisonShare/Page/ProjectContributionChangesPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ viewChangedDefinitionCard projectRef changedDefinitions branchDiff changeLine ty
branchDiff.newBranch.ref

else
branchDiff.newBranch.ref
branchDiff.oldBranch.ref
in
SyntaxConfig.empty
|> SyntaxConfig.withToClick
Expand Down Expand Up @@ -526,13 +526,19 @@ viewChangedDefinitionCard projectRef changedDefinitions branchDiff changeLine ty

ChangedDefinitions.DefinitionSyntax syntax ->
let
branchRef =
case changeLine of
ChangeLine.Removed _ _ ->
branchDiff.oldBranch.ref

_ ->
branchDiff.newBranch.ref
linked =
let
branchRef =
case changeLine of
ChangeLine.Removed _ _ ->
branchDiff.oldBranch.ref

_ ->
branchDiff.newBranch.ref
in
SyntaxConfig.empty
|> SyntaxConfig.withToClick
(Link.projectBranchDefinition projectRef branchRef)

expandedContent =
case syntax of
Expand All @@ -544,7 +550,7 @@ viewChangedDefinitionCard projectRef changedDefinitions branchDiff changeLine ty

Success s ->
pre [ class "definition-syntax monochrome" ]
[ code [] [ Syntax.view (linked branchRef) s ] ]
[ code [] [ Syntax.view linked s ] ]

Failure e ->
viewFailedToLoadExpandedContent e
Expand Down

0 comments on commit 05fe843

Please sign in to comment.