Skip to content

Commit e29e0ef

Browse files
authored
Merge pull request #879 from gadget-inc/add-install-hint-to-standalone-provider
adds the shopify install state hint to the standalone provider
2 parents 8dd2b9d + 1a572f2 commit e29e0ef

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/react-shopify-app-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gadgetinc/react-shopify-app-bridge",
3-
"version": "0.18.7",
3+
"version": "0.18.8",
44
"files": [
55
"README.md",
66
"dist/**/*"

packages/react-shopify-app-bridge/src/Provider.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,14 @@ const StandaloneInnerProvider = ({
229229
query,
230230
gadgetAppUrl,
231231
type,
232+
shopifyInstallState,
232233
}: {
233234
isRootFrameRequest: boolean;
234235
children: ReactNode;
235236
query?: URLSearchParams;
236237
gadgetAppUrl: string;
237238
type: AppType;
239+
shopifyInstallState?: ShopifyInstallState;
238240
}) => {
239241
// we still need to run the oauth process if we're in an install context so we should redirect to gadget
240242
const isInstallRequest = query?.has("hmac") && query?.has("shop");
@@ -262,7 +264,7 @@ const StandaloneInnerProvider = ({
262264
return (
263265
<GadgetAuthContext.Provider
264266
value={{
265-
isAuthenticated: false,
267+
isAuthenticated: shopifyInstallState?.isAuthenticated ?? false,
266268
isEmbedded: false,
267269
canAuth: false,
268270
loading: false,
@@ -389,7 +391,13 @@ export const Provider = ({
389391
{children}
390392
</InnerGadgetProvider>
391393
) : (
392-
<StandaloneInnerProvider isRootFrameRequest={isRootFrameRequest} query={query} type={coalescedType} gadgetAppUrl={gadgetAppUrl}>
394+
<StandaloneInnerProvider
395+
isRootFrameRequest={isRootFrameRequest}
396+
query={query}
397+
type={coalescedType}
398+
gadgetAppUrl={gadgetAppUrl}
399+
shopifyInstallState={shopifyInstallState}
400+
>
393401
{children}
394402
</StandaloneInnerProvider>
395403
)}

0 commit comments

Comments
 (0)