chore: clean up update_ui code

This commit is contained in:
Larvan2
2024-09-02 11:17:35 +08:00
parent 802267fb5b
commit 56fe7d5304
4 changed files with 38 additions and 62 deletions

View File

@@ -381,12 +381,12 @@ func updateTunnels(tunnels []LC.Tunnel) {
}
func initExternalUI() {
if updater.ExternalUIFolder != "" {
dirEntries, _ := os.ReadDir(updater.ExternalUIFolder)
if updater.AutoUpdateUI {
dirEntries, _ := os.ReadDir(updater.ExternalUIPath)
if len(dirEntries) > 0 {
log.Infoln("UI already exists")
log.Infoln("UI already exists, skip downloading")
} else {
log.Infoln("UI not exists, downloading")
log.Infoln("External UI downloading ...")
updater.UpdateUI()
}
}