1
1
<template >
2
- <div class =" main px-4 py-8 flex flex-col gap-y-2 max-w-md m-auto" >
2
+ <div v-if = " isRNSExist " class =" main px-4 py-8 flex flex-col gap-y-2 max-w-md m-auto" >
3
3
<Profile
4
4
:avatar =" rss3Profile.avatar"
5
5
:username =" rss3Profile.username"
173
173
</template >
174
174
</Modal >
175
175
</div >
176
+ <div
177
+ v-else
178
+ class =" onboarding h-full text-center bg-cover bg-fixed flex items-center justify-center bg-pass3gradient"
179
+ >
180
+ <div class =" body px-4 h-2/3 flex flex-col justify-center items-center justify-between" >
181
+ <div class =" logo-container w-50 h-50 bg-pass3logo bg-center bg-contain bg-no-repeat" ></div >
182
+ <div class =" text-primary text-2xl max-w-md" >
183
+ <p >
184
+ This RNS is not claimed yet. <br />
185
+ Grab it as yours or claim your own!
186
+ </p >
187
+ </div >
188
+ <div class =" leading-17.5 text-white w-83.5 text-2xl mx-auto" >
189
+ <Button size =" lg" class =" bg-primary shadow-primary rounded-3xl w-full h-17.5 mb-9" @click =" toSetupRNS" >
190
+ <span > Claim an RNS </span >
191
+ </Button >
192
+ <Button
193
+ size =" lg"
194
+ class =" text-primary bg-white shadow-primary rounded-3xl w-full h-17.5"
195
+ @click =" toHomePage"
196
+ >
197
+ <span > Go Home </span >
198
+ </Button >
199
+ </div >
200
+ </div >
201
+ </div >
176
202
</template >
177
203
178
204
<script lang="ts">
@@ -213,6 +239,7 @@ export default class Home extends Vue {
213
239
public isdisplaying: boolean = false ;
214
240
public dialogAddress: string = ' ' ;
215
241
public dialogChain: string = ' ' ;
242
+ isRNSExist: boolean = true ;
216
243
217
244
public rss3Profile: ProfileInfo = {
218
245
avatar: config .defaultAvatar ,
@@ -229,6 +256,10 @@ export default class Home extends Vue {
229
256
$gtag: any ;
230
257
231
258
async mounted() {
259
+ await this .initLoad ();
260
+ }
261
+
262
+ async initLoad() {
232
263
const isValidRSS3 = await RSS3 .reconnect ();
233
264
this .rss3 = await RSS3 .visitor ();
234
265
const owner: string = <string >this .rss3 .account .address ;
@@ -251,6 +282,8 @@ export default class Home extends Vue {
251
282
if (this .ethAddress === owner ) {
252
283
this .isOwner = true ;
253
284
}
285
+ } else {
286
+ this .isRNSExist = false ;
254
287
}
255
288
}
256
289
} else {
@@ -282,7 +315,7 @@ export default class Home extends Vue {
282
315
this .rss3Profile .bio = profile ?.bio || ' ' ;
283
316
this .rss3Profile .address = this .ethAddress ;
284
317
285
- this .rss3Relations .followers = await this .rss3 ?.backlinks .get (this .ethAddress , ' following' );
318
+ this .rss3Relations .followers = ( await this .rss3 ?.backlinks .get (this .ethAddress , ' following' )) || [] ;
286
319
this .rss3Relations .followings = (await this .rss3 ?.links .get (this .ethAddress , ' following' ))?.list || [];
287
320
288
321
if (data ) {
@@ -460,6 +493,16 @@ export default class Home extends Vue {
460
493
this .$router .push (` /profile ` );
461
494
}
462
495
496
+ toSetupRNS() {
497
+ this .$router .push (' /rns' );
498
+ }
499
+
500
+ async toHomePage() {
501
+ await this .$router .push (' /home' );
502
+ this .isRNSExist = true ;
503
+ await this .initLoad ();
504
+ }
505
+
463
506
public displayDialog(address : string , chain : string ) {
464
507
this .dialogAddress = address ;
465
508
this .dialogChain = chain ;
0 commit comments