From fb36f897d6f571fbb8bc302b29951abb982be464 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 17 Nov 2025 15:59:49 +0100 Subject: [PATCH] fixes --- .../Api/Model/WorkspaceContext.cs | 1 + .../Api/Plugins/Features/WorkspaceFeature.cs | 2 +- .../GitLabRepo/GitLabRepoWorkspaceFeature.cs | 2 ++ ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml | 2 +- ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml.cs | 10 ++++++---- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ModpackUpdater.Apps.Manager/Api/Model/WorkspaceContext.cs b/ModpackUpdater.Apps.Manager/Api/Model/WorkspaceContext.cs index b2a9991..b721e77 100644 --- a/ModpackUpdater.Apps.Manager/Api/Model/WorkspaceContext.cs +++ b/ModpackUpdater.Apps.Manager/Api/Model/WorkspaceContext.cs @@ -4,4 +4,5 @@ public class WorkspaceContext(IMainApi mainApi, IWorkspace? workspace) { public IMainApi MainApi => mainApi; public IWorkspace? Workspace { get; set; } = workspace; + public bool Canceled { get; set; } } \ No newline at end of file diff --git a/ModpackUpdater.Apps.Manager/Api/Plugins/Features/WorkspaceFeature.cs b/ModpackUpdater.Apps.Manager/Api/Plugins/Features/WorkspaceFeature.cs index 87235be..21ed785 100644 --- a/ModpackUpdater.Apps.Manager/Api/Plugins/Features/WorkspaceFeature.cs +++ b/ModpackUpdater.Apps.Manager/Api/Plugins/Features/WorkspaceFeature.cs @@ -14,7 +14,7 @@ public abstract class WorkspaceFeature(string identifier, string name) : PluginF { await OnConfigure(context); - if (context?.Workspace?.Config is not null) + if (!context.Canceled && context.Workspace?.Config is not null) context.Workspace.Config.ProviderId = Identifier; } diff --git a/ModpackUpdater.Apps.Manager/Features/Workspaces/GitLabRepo/GitLabRepoWorkspaceFeature.cs b/ModpackUpdater.Apps.Manager/Features/Workspaces/GitLabRepo/GitLabRepoWorkspaceFeature.cs index 6f2f2d6..4c3bc3c 100644 --- a/ModpackUpdater.Apps.Manager/Features/Workspaces/GitLabRepo/GitLabRepoWorkspaceFeature.cs +++ b/ModpackUpdater.Apps.Manager/Features/Workspaces/GitLabRepo/GitLabRepoWorkspaceFeature.cs @@ -24,6 +24,8 @@ internal class GitLabRepoWorkspaceFeature() : WorkspaceFeature("origin.gitlab", AppGlobals.Symbols.GetImageSource(AppSymbols.gitlab))) .Result is GitLabRepoWorkspaceConfig settingsNew) context.Workspace = new GitLabRepoWorkspace(settingsNew); + else + context.Canceled = true; } protected override void OnCreate(out IWorkspace workspace, WorkspaceConfig config) diff --git a/ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml b/ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml index 7c8c1e3..380c1a1 100644 --- a/ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml +++ b/ModpackUpdater.Apps.Manager/Ui/MainWindow.axaml @@ -10,7 +10,6 @@ xmlns:langRes="clr-namespace:ModpackUpdater.Apps.Manager.LangRes" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow" - x:DataType="mainWindow:MainWindowViewModel" Title="Minecraft Modpack Manager" WindowState="Maximized" Loaded="Window_OnLoaded" @@ -18,6 +17,7 @@