fix: check if publisher starts with npub rather than using isHex
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
import { isHex } from "@snort/shared";
|
|
||||||
import { EventKind, parseNostrLink } from "@snort/system";
|
import { EventKind, parseNostrLink } from "@snort/system";
|
||||||
|
|
||||||
export const LIVE_STREAM = 30_311 as EventKind;
|
export const LIVE_STREAM = 30_311 as EventKind;
|
||||||
@ -43,10 +42,10 @@ function loadWhitelist() {
|
|||||||
const list = import.meta.env.VITE_SINGLE_PUBLISHER as string | undefined;
|
const list = import.meta.env.VITE_SINGLE_PUBLISHER as string | undefined;
|
||||||
if (list) {
|
if (list) {
|
||||||
return list.split(",").map(a => {
|
return list.split(",").map(a => {
|
||||||
if (isHex(a)) {
|
if (a.startsWith('npub')) {
|
||||||
return a;
|
|
||||||
} else {
|
|
||||||
return parseNostrLink(a).id;
|
return parseNostrLink(a).id;
|
||||||
|
} else {
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user