Skip to content

Commit c2947fc

Browse files
committed
fix: Fix Flutter web platform creation
Use `hostname` instead of `key` for Flutter web platform creation.
1 parent 0cf777a commit c2947fc

File tree

1 file changed

+34
-16
lines changed

1 file changed

+34
-16
lines changed

src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
115115
projectId,
116116
platform,
117117
$createPlatform.name,
118-
$createPlatform.key || undefined,
118+
platform === PlatformType.Flutterweb ? undefined : $createPlatform.key || undefined,
119119
undefined,
120-
undefined
120+
platform === PlatformType.Flutterweb
121+
? $createPlatform.hostname || undefined
122+
: undefined
121123
);
122124
123125
isPlatformCreated = true;
@@ -189,19 +191,35 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
189191
bind:value={$createPlatform.name} />
190192

191193
<!-- Tooltips on InputText don't work as of now -->
192-
<InputText
193-
id="hostname"
194-
label={hostname[platform]}
195-
placeholder={placeholder[platform].hostname}
196-
required
197-
bind:value={$createPlatform.key}>
198-
<Tooltip slot="info" maxWidth="15rem">
199-
<Icon icon={IconInfo} size="s" />
200-
<Typography.Caption variant="400" slot="tooltip">
201-
{placeholder[platform].tooltip}
202-
</Typography.Caption>
203-
</Tooltip>
204-
</InputText>
194+
{#if platform === PlatformType.Flutterweb}
195+
<InputText
196+
id="hostname"
197+
label={hostname[platform]}
198+
placeholder={placeholder[platform].hostname}
199+
required
200+
bind:value={$createPlatform.hostname}>
201+
<Tooltip slot="info" maxWidth="15rem">
202+
<Icon icon={IconInfo} size="s" />
203+
<Typography.Caption variant="400" slot="tooltip">
204+
{placeholder[platform].tooltip}
205+
</Typography.Caption>
206+
</Tooltip>
207+
</InputText>
208+
{:else}
209+
<InputText
210+
id="key"
211+
label={hostname[platform]}
212+
placeholder={placeholder[platform].hostname}
213+
required
214+
bind:value={$createPlatform.key}>
215+
<Tooltip slot="info" maxWidth="15rem">
216+
<Icon icon={IconInfo} size="s" />
217+
<Typography.Caption variant="400" slot="tooltip">
218+
{placeholder[platform].tooltip}
219+
</Typography.Caption>
220+
</Tooltip>
221+
</InputText>
222+
{/if}
205223
</Layout.Stack>
206224

207225
<Button
@@ -212,7 +230,7 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
212230
submissionLoader={isCreatingPlatform}
213231
disabled={!platform ||
214232
!$createPlatform.name ||
215-
!$createPlatform.key ||
233+
(!$createPlatform.key && !$createPlatform.hostname) ||
216234
isCreatingPlatform}>
217235
Create platform
218236
</Button>

0 commit comments

Comments
 (0)