File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
apps/client/src/pages/home Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1414 <Gap style =" height : 24px " />
1515
1616 <DeepBtn
17- label =" Resend verification email"
17+ :label =" `Resend verification email${
18+ secondsRemaining > 0 ? ` (${secondsRemaining}s)` : ''
19+ }`"
1820 color =" primary"
1921 style =" font-size : 16px ; padding : 10px 22px "
2022 @click =" resendVerificationEmail()"
23+ :disabled =" secondsRemaining > 0"
2124 />
2225
2326 <Gap style =" height : 64px " />
3437</template >
3538
3639<script setup lang="ts">
40+ import { useIntervalFn } from ' @vueuse/core' ;
3741import { handleError } from ' src/code/utils/misc' ;
3842
3943useMeta (() => ({
4044 title: ' Finish registration - DeepNotes' ,
4145}));
4246
47+ const secondsRemaining = ref (60 );
48+
49+ useIntervalFn (() => {
50+ secondsRemaining .value -- ;
51+ }, 1000 );
52+
4353async function resendVerificationEmail() {
4454 try {
4555 await trpcClient .users .account .resendVerificationEmail .mutate ({
46- email: internals .sessionStorage ?.getItem (' email' ),
56+ email: internals .sessionStorage ?.getItem (' email' )! ,
4757 });
4858
4959 $quasar ().notify ({
5060 message: ' Verification email resent.' ,
5161 type: ' positive' ,
5262 });
63+
64+ secondsRemaining .value = 60 ;
5365 } catch (error ) {
5466 handleError (error );
5567 }
You can’t perform that action at this time.
0 commit comments