Skip to content

Commit

Permalink
MWPW-140091-[Firefly Marquee]implementation for new fix from product …
Browse files Browse the repository at this point in the history
…team (#135)

* Firefly Interactive Marquee

* remove important from css

* remove unnecessary css class

* MWPW-140091-implementation for new fix from product team

* add seed query param

---------

Co-authored-by: Ruchika Sinha <tek10248@Ruchikas-MacBook-Pro.local>
  • Loading branch information
Ruchika4 and Ruchika Sinha authored Dec 6, 2023
1 parent c8556b2 commit 77bdf81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion creativecloud/features/firefly/firefly-susi.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const fireflyprod = 'https://firefly.adobe.com';
const fireflystage = 'https://firefly-stage.corp.adobe.com';
const env = window.origin.includes(config.prodDomains[0]) ? 'prod' : 'stage';

function generateRandomSeed(min = 1, max = 100000) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}

export function redirectWithParam() {
const url = new URL(window.location.href);
let prompt;
Expand All @@ -19,7 +23,7 @@ export function redirectWithParam() {
windowLocation = env === 'prod' ? `${fireflyprod}/${effectsPath}` : `${fireflystage}/${effectsPath}`;
} else if (window.location.search.includes('goToFirefly')) {
prompt = url.searchParams.get('goToFirefly');
const fireflyPath = `generate/images?prompt=${prompt}&${queryParam}&modelInputVersion=v2&modelConfig=v2`;
const fireflyPath = `generate/images?prompt=${prompt}&${queryParam}&seed=${generateRandomSeed()}&seed=${generateRandomSeed()}&seed=${generateRandomSeed()}&seed=${generateRandomSeed()}&modelInputVersion=v2&modelConfig=v2`;
windowLocation = env === 'prod' ? `${fireflyprod}/${fireflyPath}` : `${fireflystage}/${fireflyPath}`;
}
if (windowLocation) window.location = windowLocation;
Expand Down

0 comments on commit 77bdf81

Please sign in to comment.