mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-07-01 21:06:29 +08:00
fix: show localhost address when scan is enabled & connected
This commit is contained in:
@ -152,7 +152,7 @@ class _ServerManagementPanelState extends CustomState<ServerManagementPanel, voi
|
||||
: SocketState.disconnected))),
|
||||
if ((controller.serverVersionCode.value ?? 0) >= 42)
|
||||
const TextSpan(text: "\n\n"),
|
||||
TextSpan(text: "Server URL: ${redact ? "Redacted" : ss.settings.serverAddress.value}", recognizer: TapGestureRecognizer()
|
||||
TextSpan(text: "Server URL: ${redact ? "Redacted" : http.originOverride ?? ss.settings.serverAddress.value}", recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Clipboard.setData(ClipboardData(text: ss.settings.serverAddress.value));
|
||||
showSnackbar('Copied', "Address copied to clipboard");
|
||||
|
@ -49,7 +49,7 @@ class NetworkTasks {
|
||||
}
|
||||
}
|
||||
if (address != null) {
|
||||
http.originOverride = "http://$address:${ss.settings.localhostPort.value}/api/v1";
|
||||
http.originOverride = "http://$address:${ss.settings.localhostPort.value}";
|
||||
} else {
|
||||
http.originOverride = null;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class HttpService extends GetxService {
|
||||
String? originOverride;
|
||||
|
||||
/// Get the URL origin from the current server address
|
||||
String get origin => originOverride ?? "${Uri.parse(ss.settings.serverAddress.value).origin}/api/v1";
|
||||
String get origin => "${originOverride ?? Uri.parse(ss.settings.serverAddress.value).origin}/api/v1";
|
||||
|
||||
/// Helper function to build query params, this way we only need to add the
|
||||
/// required guid auth param in one place
|
||||
|
Reference in New Issue
Block a user