Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Last active August 19, 2023 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonLaster/9a3103c37394a5e039471ccf9ed0e282 to your computer and use it in GitHub Desktop.
Save jasonLaster/9a3103c37394a5e039471ccf9ed0e282 to your computer and use it in GitHub Desktop.
commit 9179ca9fb9c7e50ef2d1bcc0652829ecd83bb1b6
Author: Jason Laster <jason.laster.11@gmail.com>
Date: Sat Aug 19 15:23:11 2023 -0700
Remove adName
diff --git a/file.ts b/file.ts
index 8bfa8de..e9299a7 100644
--- a/PromotedPinFormDetails.js
+++ b/PromotedPinFormDetails.js
@@ -136,15 +136,10 @@ export default function PromotedPinFormDetails(props: Props): Node {
quiz_answer_count = '0',
} = promotedPinData || {};
- const [adName, setAdName] = useState<?string>(name);
const [destinationUrl, setDestinationUrl] = useState<?string>(destination_url);
const isLeadAd = hasLeadForm(promotedPinData);
const [isAppSelected, setIsAppSelected] = useState<boolean>(false);
- useEffect(() => {
- setAdName(name);
- }, [name]);
-
useEffect(() => {
setDestinationUrl(destination_url);
}, [destination_url]);
@@ -430,7 +425,7 @@ export default function PromotedPinFormDetails(props: Props): Node {
id="name"
name="adName"
pinId={pinId}
- value={adName}
+ value={name}
label={i18n._(
'Ad name',
'[m10n] createFlow.adForm.promotedPinFormDetails.adNameLabel',
@@ -443,7 +438,6 @@ export default function PromotedPinFormDetails(props: Props): Node {
)}
iconButton={renderAdNameTooltip(i18n) || null}
handleTextFieldChange={({ value: string }) => {
- setAdName(string);
// $FlowFixMe[incompatible-call] http://pinch/flow-exact-empty-objects
dispatch(updatePinPromotionForm(adGroupId, pinId, { name: string }));
}}
@@ -527,7 +521,7 @@ export default function PromotedPinFormDetails(props: Props): Node {
// $FlowFixMe[incompatible-type] http://pinch/flow-exact-empty-objects
pinId={pinId}
adGroupId={adGroupId}
- adName={adName}
+ adName={name}
leadForm={leadForm}
formValidationErrors={formValidationErrors}
/>
@@ -538,7 +532,7 @@ export default function PromotedPinFormDetails(props: Props): Node {
promotedPinData={promotedPinData}
adGroupId={adGroupId}
pinId={pinId}
- adName={adName}
+ adName={name}
isReadOnlyMode={isQuizReadOnlyMode}
/>
)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment