From 8bf66dc0d569cee5b06a9e33bfc5db2199c7d80c Mon Sep 17 00:00:00 2001 From: vadym Date: Mon, 12 Dec 2022 19:56:06 +0200 Subject: [PATCH] fixed peer save bug when user was not able to save it for Windows OS --- contrib/ui/mesh-ui/webview.go | 9 --------- contrib/ui/mesh-ui/webview_windows.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/contrib/ui/mesh-ui/webview.go b/contrib/ui/mesh-ui/webview.go index 0ef8e776..946b728b 100644 --- a/contrib/ui/mesh-ui/webview.go +++ b/contrib/ui/mesh-ui/webview.go @@ -176,15 +176,6 @@ func check(peer string) int64 { return d.Milliseconds() } -func get_user_home_path() string { - path, exists := os.LookupEnv("HOME") - if exists { - return path - } else { - return "" - } -} - func run(w webview.WebView) { get_self(w) get_peers(w) diff --git a/contrib/ui/mesh-ui/webview_windows.go b/contrib/ui/mesh-ui/webview_windows.go index 556afedd..872f3b63 100755 --- a/contrib/ui/mesh-ui/webview_windows.go +++ b/contrib/ui/mesh-ui/webview_windows.go @@ -4,9 +4,19 @@ package main import ( + "os" "syscall" ) +func get_user_home_path() string { + path, exists := os.LookupEnv("USERPROFILE") + if exists { + return path + } else { + return "" + } +} + func Console(show bool) { var getWin = syscall.NewLazyDLL("kernel32.dll").NewProc("GetConsoleWindow") var showWin = syscall.NewLazyDLL("user32.dll").NewProc("ShowWindow")