From 4978c10f9852f52043b35957f4e3bf4d9e60ce0f Mon Sep 17 00:00:00 2001 From: Matteo Cominetti Date: Mon, 11 Dec 2023 21:39:48 +0000 Subject: [PATCH] fix(dui): broken fe2 url when in oneclick mode (#3098) * fix(dui): broken fe2 url when in oneclick mode * fix(dui): Formatting and unnecessary using --------- Co-authored-by: Alan Rynne --- .../DesktopUI2/ViewModels/OneClickViewModel.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/DesktopUI2/DesktopUI2/ViewModels/OneClickViewModel.cs b/DesktopUI2/DesktopUI2/ViewModels/OneClickViewModel.cs index 88795f6bb3..35a8a622d9 100644 --- a/DesktopUI2/DesktopUI2/ViewModels/OneClickViewModel.cs +++ b/DesktopUI2/DesktopUI2/ViewModels/OneClickViewModel.cs @@ -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; @@ -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}"; + } } }