mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 01:11:07 +03:00
fix(mobile): copy shared link (#6310)
* fix(mobile): copy shared link * fix: handle trailing slash --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -76,8 +76,11 @@ class SharedLinkItem extends ConsumerWidget {
|
||||
final externalDomain = ref.read(
|
||||
serverInfoProvider.select((s) => s.serverConfig.externalDomain),
|
||||
);
|
||||
final serverUrl =
|
||||
var serverUrl =
|
||||
externalDomain.isNotEmpty ? externalDomain : getServerUrl();
|
||||
if (serverUrl != null && !serverUrl.endsWith('/')) {
|
||||
serverUrl += '/';
|
||||
}
|
||||
if (serverUrl == null) {
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
@@ -89,9 +92,7 @@ class SharedLinkItem extends ConsumerWidget {
|
||||
}
|
||||
|
||||
Clipboard.setData(
|
||||
ClipboardData(
|
||||
text: "$serverUrl/share/${sharedLink.key}",
|
||||
),
|
||||
ClipboardData(text: "${serverUrl}share/${sharedLink.key}"),
|
||||
).then((_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
|
||||
Reference in New Issue
Block a user