fixed peer save bug when user was not able to save it for Windows OS

This commit is contained in:
vadym 2022-12-12 19:56:06 +02:00
parent 9f5738b812
commit 8bf66dc0d5
2 changed files with 10 additions and 9 deletions

View file

@ -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)

View file

@ -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")