Support for custom domain url replacement

This commit is contained in:
Neeraj Gupta
2025-08-12 11:55:24 +05:30
parent f248dbabe0
commit 5e993b9526
2 changed files with 9 additions and 1 deletions

View File

@@ -755,10 +755,16 @@ class CollectionsService {
String getPublicUrl(Collection c) {
final PublicURL url = c.publicURLs.firstOrNull!;
Uri publicUrl = Uri.parse(url.url);
final String customDomain = flagService.customDomain;
if (customDomain.isNotEmpty) {
publicUrl =
publicUrl.replace(host: customDomain, scheme: "https", port: 443);
}
final String collectionKey = Base58Encode(
CollectionsService.instance.getCollectionKey(c.id),
);
final String urlValue = "${url.url}#$collectionKey";
final String urlValue = "${publicUrl.toString()}#$collectionKey";
return urlValue;
}

View File

@@ -60,6 +60,8 @@ class FlagService {
String get castUrl => flags.castUrl;
String get customDomain => flags.customDomain;
bool hasSyncedAccountFlags() {
return _prefs.containsKey("remote_flags");
}