Define XXX

This commit is contained in:
Kieran 2023-08-06 14:56:43 +01:00
parent e607df56df
commit b9f0d349ef
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/// <reference types="@webbtc/webln-types" />
declare const __XXX: boolean;
declare module "*.jpg" {
const value: unknown;
export default value;

View File

@ -37,7 +37,15 @@ export function useStreamsFeed(tag?: string) {
const feed = useRequestBuilder<NoteCollection>(System, NoteCollection, rb);
const feedSorted = useMemo(() => {
if (feed.data) {
return [...feed.data];
if (__XXX) {
return [...feed.data].filter(
(a) => findTag(a, "content-warning") !== undefined
);
} else {
return [...feed.data].filter(
(a) => findTag(a, "content-warning") === undefined
);
}
}
return [];
}, [feed.data]);

View File

@ -65,6 +65,9 @@ const config = {
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/,
}),
new webpack.DefinePlugin({
__XXX: process.env["__XXX"] || JSON.stringify(false)
})
],
module: {