Skip to content

Commit 9454bad

Browse files
committed
close handler
1 parent e1d0bca commit 9454bad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/routes/(console)/organization-[organization]/enterpriseTrial.svelte

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66
import { base } from '$app/paths';
77
import GradientBanner from '$lib/components/billing/gradientBanner.svelte';
88
import { Badge, Typography } from '@appwrite.io/pink-svelte';
9+
import { activeHeaderAlert } from '../store';
910
1011
$: upgradeUrl = `${base}/organization-${$organization?.$id}/change-plan`;
1112
$: remainingDays = calculateEnterpriseTrial($organization);
13+
14+
let show = true;
15+
16+
function handleClose() {
17+
show = false;
18+
const now = new Date().getTime();
19+
localStorage.setItem($activeHeaderAlert.id, now.toString());
20+
}
1221
</script>
1322

14-
{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
15-
<GradientBanner variant="image">
23+
{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname) && show}
24+
<GradientBanner variant="image" on:close={handleClose}>
1625
<div class="banner-fullwidth-grid">
1726
<Typography.Text>
1827
Your enterprise trial expires in <Badge

0 commit comments

Comments
 (0)