Open NSFW streams on xxx host
This commit is contained in:
@ -52,7 +52,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack serve",
|
"start": "webpack serve",
|
||||||
"build": "webpack --node-env=production",
|
"build": "webpack --node-env=production",
|
||||||
"deploy": "npx wrangler pages publish build"
|
"deploy": "yarn build && npx wrangler pages publish build",
|
||||||
|
"deploy:xxzap": "__XXX='true' && yarn build && npx wrangler pages publish --project-name xxzap build"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
1
src/d.ts
1
src/d.ts
@ -2,6 +2,7 @@
|
|||||||
/// <reference types="@webbtc/webln-types" />
|
/// <reference types="@webbtc/webln-types" />
|
||||||
|
|
||||||
declare const __XXX: boolean;
|
declare const __XXX: boolean;
|
||||||
|
declare const __XXX_HOST: string;
|
||||||
|
|
||||||
declare module "*.jpg" {
|
declare module "*.jpg" {
|
||||||
const value: unknown;
|
const value: unknown;
|
||||||
|
@ -7,7 +7,7 @@ import { StreamProvider, StreamProviders } from "providers";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { eventLink } from "utils";
|
import { eventLink, findTag } from "utils";
|
||||||
import { NostrProviderDialog } from "./nostr-provider-dialog";
|
import { NostrProviderDialog } from "./nostr-provider-dialog";
|
||||||
|
|
||||||
function NewStream({ ev, onFinish }: StreamEditorProps) {
|
function NewStream({ ev, onFinish }: StreamEditorProps) {
|
||||||
@ -35,9 +35,13 @@ function NewStream({ ev, onFinish }: StreamEditorProps) {
|
|||||||
onFinish={(ex) => {
|
onFinish={(ex) => {
|
||||||
currentProvider.updateStreamInfo(ex);
|
currentProvider.updateStreamInfo(ex);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
navigate(`/${eventLink(ex)}`, {
|
if (findTag(ex, "content-warning") && __XXX_HOST) {
|
||||||
state: ev,
|
location.href = `${__XXX_HOST}/${eventLink(ex)}`;
|
||||||
});
|
} else {
|
||||||
|
navigate(`/${eventLink(ex)}`, {
|
||||||
|
state: ev,
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
onFinish?.(ev);
|
onFinish?.(ev);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,8 @@ const config = {
|
|||||||
contextRegExp: /moment$/,
|
contextRegExp: /moment$/,
|
||||||
}),
|
}),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__XXX: process.env["__XXX"] || JSON.stringify(false)
|
__XXX: process.env["__XXX"] || JSON.stringify(false),
|
||||||
|
__XXX_HOST: JSON.stringify("https://xxzap.com")
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
|
Reference in New Issue
Block a user