diff --git a/package-lock.json b/package-lock.json index b5e28ead..7c3fc711 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7287,8 +7287,8 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "san-webkit": { - "version": "git+https://github.com/santiment/san-webkit.git#b533fd51c6976cc4a7bbead11618eb600f9dffa0", - "from": "git+https://github.com/santiment/san-webkit.git#b533fd5", + "version": "git+https://github.com/santiment/san-webkit.git#337850c1b909c170f9d49fafd434654bc8219326", + "from": "git+https://github.com/santiment/san-webkit.git#337850c", "requires": { "fast-glob": "^3.2.5", "patch-package": "^6.4.7" diff --git a/package.json b/package.json index 142ee59a..b5721023 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "polka": "next", "react": "^16.14.0", "react-dom": "^16.14.0", - "san-webkit": "https://github.com/santiment/san-webkit#b533fd5", + "san-webkit": "https://github.com/santiment/san-webkit#337850c", "sanitize-html": "1.20.1", "sirv": "^1.0.0", "turndown": "^7.1.1" diff --git a/src/components/Nav/index.svelte b/src/components/Nav/index.svelte index aae30d8e..463ff98a 100644 --- a/src/components/Nav/index.svelte +++ b/src/components/Nav/index.svelte @@ -2,19 +2,25 @@ import Product from 'webkit/ui/Product.svelte' import Products from 'webkit/ui/Products/svelte' import NftButton from 'webkit/ui/ChristmasNFTDialog/Button.svelte' - import { checkWasNftDialogClosedOnce } from 'webkit/ui/ChristmasNFTDialog/api' - import { showChristmasNFTDialog } from 'webkit/ui/ChristmasNFTDialog/Dialog.svelte' + import { queryUserNftInsights } from 'webkit/ui/ChristmasNFTDialog/api' + import { currentUser as currentUser$ } from '@/stores/user' import Search from './Search.svelte' import Account from './Account.svelte' import { onDestroy, onMount } from 'svelte' let isMenuOpened = false - + let insights = [] let timer + + $: currentUser = $currentUser$ + $: discountCode = currentUser && +currentUser.id === 2414 ? 'caKHq5Zo' : '' + $: isNftWinner = currentUser && currentUser.sanbaseNft && currentUser.sanbaseNft.hasValidNft + $: isDiscountWinner = discountCode && insights.length + onMount(() => { - if (!checkWasNftDialogClosedOnce()) { - timer = setTimeout(() => showChristmasNFTDialog(), 2000) - } + queryUserNftInsights().then((data) => { + insights = data + }) window.onNftGameStart = () => { const data = { campaign_participant: 'nft_battle_2022' } @@ -50,7 +56,11 @@
-