Open NSFW streams on xxx host

This commit is contained in:
Kieran 2023-08-06 15:35:39 +01:00
parent b9f0d349ef
commit d44e4c1a94
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
4 changed files with 13 additions and 6 deletions

View File

@ -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": [

View File

@ -2,6 +2,7 @@
/// <reference types="@webbtc/webln-types" />
declare const __XXX: boolean;
declare const __XXX_HOST: string;
declare module "*.jpg" {
const value: unknown;

View File

@ -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) {
navigate(`/${eventLink(ex)}`, {
state: ev,
});
if (findTag(ex, "content-warning") && __XXX_HOST) {
location.href = `${__XXX_HOST}/${eventLink(ex)}`;
} else {
navigate(`/${eventLink(ex)}`, {
state: ev,
});
}
} else {
onFinish?.(ev);
}

View File

@ -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: {