forked from Kieran/zap.stream
Open NSFW streams on xxx host
This commit is contained in:
parent
b9f0d349ef
commit
d44e4c1a94
@ -52,7 +52,8 @@
|
||||
"scripts": {
|
||||
"start": "webpack serve",
|
||||
"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": {
|
||||
"extends": [
|
||||
|
1
src/d.ts
1
src/d.ts
@ -2,6 +2,7 @@
|
||||
/// <reference types="@webbtc/webln-types" />
|
||||
|
||||
declare const __XXX: boolean;
|
||||
declare const __XXX_HOST: string;
|
||||
|
||||
declare module "*.jpg" {
|
||||
const value: unknown;
|
||||
|
@ -7,7 +7,7 @@ import { StreamProvider, StreamProviders } from "providers";
|
||||
import { useEffect, useState } from "react";
|
||||
import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { eventLink } from "utils";
|
||||
import { eventLink, findTag } from "utils";
|
||||
import { NostrProviderDialog } from "./nostr-provider-dialog";
|
||||
|
||||
function NewStream({ ev, onFinish }: StreamEditorProps) {
|
||||
@ -35,9 +35,13 @@ function NewStream({ ev, onFinish }: StreamEditorProps) {
|
||||
onFinish={(ex) => {
|
||||
currentProvider.updateStreamInfo(ex);
|
||||
if (!ev) {
|
||||
if (findTag(ex, "content-warning") && __XXX_HOST) {
|
||||
location.href = `${__XXX_HOST}/${eventLink(ex)}`;
|
||||
} else {
|
||||
navigate(`/${eventLink(ex)}`, {
|
||||
state: ev,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
onFinish?.(ev);
|
||||
}
|
||||
|
@ -67,7 +67,8 @@ const config = {
|
||||
contextRegExp: /moment$/,
|
||||
}),
|
||||
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: {
|
||||
|
Loading…
Reference in New Issue
Block a user