From a7325e4d2dbd51f4737399e20fb8ae7d8044475f Mon Sep 17 00:00:00 2001 From: Nico Domino Date: Tue, 24 Sep 2024 16:03:02 +0200 Subject: [PATCH] fix: log and show toast (#4965) --- apps/desktop/src/lib/backend/projects.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/desktop/src/lib/backend/projects.ts b/apps/desktop/src/lib/backend/projects.ts index 1ba85c699..526bfe4ca 100644 --- a/apps/desktop/src/lib/backend/projects.ts +++ b/apps/desktop/src/lib/backend/projects.ts @@ -158,25 +158,21 @@ export class ProjectService { return path; } - validateProjectPath(path: string, showErrors = true) { + validateProjectPath(path: string) { if (/^\\\\wsl.localhost/i.test(path)) { - if (showErrors) { - showError( - 'Use the Linux version of GitButler', - 'For WSL2 projects, install the Linux version of GitButler inside of your WSL2 distro' - ); - } + const errorMsg = + 'For WSL2 projects, install the Linux version of GitButler inside of your WSL2 distro'; + console.error(errorMsg); + showError('Use the Linux version of GitButler', errorMsg); return false; } if (/^\\\\/i.test(path)) { - if (showErrors) { - showError( - 'UNC Paths are not directly supported', - 'Using git across a network is not recommended. Either clone the repo locally, or use the NET USE command to map a network drive' - ); - } + const errorMsg = + 'Using git across a network is not recommended. Either clone the repo locally, or use the NET USE command to map a network drive'; + console.error(errorMsg); + showError('UNC Paths are not directly supported', errorMsg); return false; }