Support for custom domain url replacement
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ class FlagService {
|
||||
|
||||
String get castUrl => flags.castUrl;
|
||||
|
||||
String get customDomain => flags.customDomain;
|
||||
|
||||
bool hasSyncedAccountFlags() {
|
||||
return _prefs.containsKey("remote_flags");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user