mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-07-03 06:16:52 +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))),
|
: SocketState.disconnected))),
|
||||||
if ((controller.serverVersionCode.value ?? 0) >= 42)
|
if ((controller.serverVersionCode.value ?? 0) >= 42)
|
||||||
const TextSpan(text: "\n\n"),
|
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 = () {
|
..onTap = () {
|
||||||
Clipboard.setData(ClipboardData(text: ss.settings.serverAddress.value));
|
Clipboard.setData(ClipboardData(text: ss.settings.serverAddress.value));
|
||||||
showSnackbar('Copied', "Address copied to clipboard");
|
showSnackbar('Copied', "Address copied to clipboard");
|
||||||
|
@ -49,7 +49,7 @@ class NetworkTasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
http.originOverride = "http://$address:${ss.settings.localhostPort.value}/api/v1";
|
http.originOverride = "http://$address:${ss.settings.localhostPort.value}";
|
||||||
} else {
|
} else {
|
||||||
http.originOverride = null;
|
http.originOverride = null;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ class HttpService extends GetxService {
|
|||||||
String? originOverride;
|
String? originOverride;
|
||||||
|
|
||||||
/// Get the URL origin from the current server address
|
/// 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
|
/// Helper function to build query params, this way we only need to add the
|
||||||
/// required guid auth param in one place
|
/// required guid auth param in one place
|
||||||
|
Reference in New Issue
Block a user