mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 18:02:27 +00:00
Refine profile modal service dependencies
This commit is contained in:
1 parent
56cf4aa8e6
commit
73be11403b
2 files changed
+8
-55
No files matched your search
@@ -111,6 +111,7 @@ const SERVICE_CONTRACT = [
|
||||
type: "function",
|
||||
description:
|
||||
"Sends an administrative notification when moderators/whitelist/blacklist entries change.",
|
||||
optional: true,
|
||||
},
|
||||
{
|
||||
key: "describeAdminError",
|
||||
@@ -246,6 +247,9 @@ function buildServicesContract(services = {}) {
|
||||
SERVICE_CONTRACT.forEach((definition) => {
|
||||
const value = services[definition.key];
|
||||
if (value == null) {
|
||||
if (definition.optional) {
|
||||
return;
|
||||
}
|
||||
missing.push(`- ${definition.key}: ${definition.description}`);
|
||||
return;
|
||||
}
|
||||
@@ -341,7 +345,9 @@ export class ProfileModalController {
|
||||
this.safeDecodeNpub = this.services.safeDecodeNpub;
|
||||
this.truncateMiddle = this.services.truncateMiddle;
|
||||
this.sendAdminListNotificationService =
|
||||
this.services.sendAdminListNotification;
|
||||
typeof this.services.sendAdminListNotification === "function"
|
||||
? this.services.sendAdminListNotification
|
||||
: null;
|
||||
this.describeAdminErrorService = this.services.describeAdminError;
|
||||
this.describeNotificationErrorService =
|
||||
this.services.describeNotificationError;
|
||||
|
||||
Reference in new issue
Block a user