clash-api: Move default mode to first

This commit is contained in:
世界 2023-09-03 21:13:16 +08:00
parent 55c34e3fb0
commit b9310154a7
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -90,7 +90,7 @@ func NewServer(ctx context.Context, router adapter.Router, logFactory log.Observ
defaultMode = options.DefaultMode defaultMode = options.DefaultMode
} }
if !common.Contains(server.modeList, defaultMode) { if !common.Contains(server.modeList, defaultMode) {
server.modeList = append(server.modeList, defaultMode) server.modeList = append([]string{defaultMode}, server.modeList...)
} }
server.mode = defaultMode server.mode = defaultMode
if options.StoreMode || options.StoreSelected || options.StoreFakeIP || options.ExternalController == "" { if options.StoreMode || options.StoreSelected || options.StoreFakeIP || options.ExternalController == "" {