mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00: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:
parent
0e0a472de1
commit
4f942bc182
3 changed files with 11 additions and 16 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue