Skip to content

Commit

Permalink
fix(dui): broken fe2 url when in oneclick mode (#3098)
Browse files Browse the repository at this point in the history
* fix(dui): broken fe2 url when in oneclick mode

* fix(dui): Formatting and unnecessary using

---------

Co-authored-by: Alan Rynne <[email protected]>
  • Loading branch information
teocomi and AlanRynne authored Dec 11, 2023
1 parent 7397e53 commit 4978c10
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions DesktopUI2/DesktopUI2/ViewModels/OneClickViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Avalonia;
Expand Down Expand Up @@ -299,13 +298,21 @@ private string Url
{
get
{
var commit = "";
if (!string.IsNullOrEmpty(Id))
var account = AccountManager.GetDefaultAccount();
if (account.serverInfo.frontend2)
{
commit = "commits/" + Id;
return $"{_fileStream.ServerUrl.TrimEnd('/')}/projects/{_fileStream.StreamId}";
}
else
{
var commit = "";
if (!string.IsNullOrEmpty(Id))
{
commit = "commits/" + Id;
}

return $"{_fileStream.ServerUrl.TrimEnd('/')}/streams/{_fileStream.StreamId}/{commit}";
return $"{_fileStream.ServerUrl.TrimEnd('/')}/streams/{_fileStream.StreamId}/{commit}";
}
}
}

Expand Down

0 comments on commit 4978c10

Please sign in to comment.