@@ -105,16 +105,12 @@ class BackendController extends GetxController {
105
105
return ;
106
106
}
107
107
108
+ final serverType = type.value;
108
109
final hostData = this .host.text.trim ();
109
110
final portData = this .port.text.trim ();
110
- if ( type () != ServerType .local) {
111
- started.value = true ;
111
+ started.value = true ;
112
+ if (serverType != ServerType .local || portData != kDefaultBackendPort. toString ()) {
112
113
yield ServerResult (ServerResultType .starting);
113
- }else {
114
- started.value = false ;
115
- if (portData != kDefaultBackendPort.toString ()) {
116
- yield ServerResult (ServerResultType .starting);
117
- }
118
114
}
119
115
120
116
if (hostData.isEmpty) {
@@ -136,7 +132,7 @@ class BackendController extends GetxController {
136
132
return ;
137
133
}
138
134
139
- if ((type () != ServerType .local || portData != kDefaultBackendPort.toString ()) && ! (await isBackendPortFree ())) {
135
+ if ((serverType != ServerType .local || portData != kDefaultBackendPort.toString ()) && ! (await isBackendPortFree ())) {
140
136
yield ServerResult (ServerResultType .freeingPort);
141
137
final result = await freeBackendPort ();
142
138
yield ServerResult (result ? ServerResultType .freePortSuccess : ServerResultType .freePortError);
@@ -146,7 +142,7 @@ class BackendController extends GetxController {
146
142
}
147
143
}
148
144
149
- switch (type () ){
145
+ switch (serverType ){
150
146
case ServerType .embedded:
151
147
final process = await startEmbeddedBackend (detached.value);
152
148
embeddedProcessPid = process.pid;
@@ -173,6 +169,10 @@ class BackendController extends GetxController {
173
169
}
174
170
175
171
localServer = await startRemoteBackendProxy (Uri .parse ("http://$kDefaultBackendHost :$portData " ));
172
+ }else {
173
+ // If the local server is running on port 3551 there is no reverse proxy running
174
+ // We only need to check if everything is working
175
+ started.value = false ;
176
176
}
177
177
178
178
break ;
0 commit comments