fix build errors
This commit is contained in:
parent
bf21089f97
commit
df35e1fd20
|
@ -58,7 +58,8 @@ export default function Share({
|
|||
}
|
||||
|
||||
// function to generate a link to a the moment in the song based on the played clips, input variable is how many seconds ago
|
||||
function generateLink(secondsAgo: number) {
|
||||
const generateLink = useCallback(
|
||||
(secondsAgo: number) => {
|
||||
var prompt;
|
||||
var seed;
|
||||
var denoising;
|
||||
|
@ -160,7 +161,9 @@ export default function Share({
|
|||
alphaVelocityString;
|
||||
|
||||
return shareUrl;
|
||||
}
|
||||
},
|
||||
[nowPlayingResult, inferenceResults]
|
||||
);
|
||||
|
||||
const getRedditLink = useCallback(() => {
|
||||
if (inferenceResults.length == 0) {
|
||||
|
@ -172,7 +175,7 @@ export default function Share({
|
|||
const encodedPrompt = encodeURIComponent(result.input.start.prompt);
|
||||
const encodedUrl = encodeURIComponent(generateLink(0));
|
||||
return `https://www.reddit.com/r/riffusion/submit?title=Prompt:+${encodedPrompt}&url=${encodedUrl}`;
|
||||
}, [nowPlayingResult, inferenceResults]);
|
||||
}, [nowPlayingResult, inferenceResults, generateLink]);
|
||||
|
||||
const getTwitterLink = useCallback(() => {
|
||||
if (inferenceResults.length == 0) {
|
||||
|
@ -187,7 +190,7 @@ export default function Share({
|
|||
return `https://twitter.com/intent/tweet?&text=Check+out+this+prompt+on+%23riffusion:+${encodeURI(
|
||||
'"'
|
||||
)}${encodedPrompt}${encodeURI('"')}${encodeURI("\n\n")}${encodedUrl}`;
|
||||
}, [nowPlayingResult, inferenceResults]);
|
||||
}, [nowPlayingResult, inferenceResults, generateLink]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -476,7 +476,7 @@ export default function Home() {
|
|||
<h2 className="pt-10 pb-5 text-3xl font-bold">Samples</h2>
|
||||
<p>
|
||||
Some of our favorite prompts and results. Check out{" "}
|
||||
<a href="http://reddit.com/r/riffusion" target="_blank">
|
||||
<a href="http://reddit.com/r/riffusion" target="_blank" rel="noreferrer">
|
||||
/r/riffusion
|
||||
</a>{" "}
|
||||
for more.
|
||||
|
|
Loading…
Reference in New Issue