fix: close direct link dialog when you click on save (#1412)

This commit is contained in:
Ephraim Duncan
2024-10-21 04:33:21 +00:00
committed by GitHub
parent 1a9dcadba5
commit 1a73c68d07
2 changed files with 6 additions and 5 deletions

View File

@ -434,12 +434,14 @@ export const TemplateDirectLinkDialog = ({
<Button
type="button"
loading={isTogglingTemplateAccess}
onClick={async () =>
toggleTemplateDirectLink({
onClick={async () => {
await toggleTemplateDirectLink({
templateId: template.id,
enabled: isEnabled,
})
}
}).catch((e) => null);
onOpenChange(false);
}}
>
<Trans>Save</Trans>
</Button>

View File

@ -112,7 +112,6 @@ test('[DIRECT_TEMPLATES]: toggle direct template link', async ({ page }) => {
await page.getByRole('switch').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByText('Direct link signing has been').first()).toBeVisible();
await page.getByLabel('Direct Link Signing', { exact: true }).press('Escape');
// Check that the direct template link is no longer accessible.
await page.goto(formatDirectTemplatePath(template.directLink?.token || ''));