jbilcke-hf HF staff commited on
Commit
24fa60f
·
1 Parent(s): 1e7eef3

let's stop using Hugging Face login, as it's not working

Browse files
src/app/views/user-account-view/index.tsx CHANGED
@@ -42,14 +42,15 @@ export function UserAccountView() {
42
  })
43
  }, [isLoaded, apiKey, userChannels.map(c => c.id).join(","), setUserChannels, setLoaded])
44
 
 
 
45
  return (
46
  <div className={cn(`flex flex-col space-y-4`)}>
47
 
48
- {
49
- // this is a beta feature, only necessary for users who use Clap files
50
- user?.userName.startsWith("jbilcke")
51
- ? <div className="flex flex-row space-x-2 items-center">
52
- <label className="flex w-64">Save videos to my HF account</label>
53
  <Input
54
  placeholder="Hugging Face token (with WRITE access)"
55
  type="password"
@@ -59,13 +60,16 @@ export function UserAccountView() {
59
  }}
60
  value={longStandingApiKey}
61
  />
62
- </div> : null}
63
 
64
  {apiKey ?
65
  <div className="flex flex-col space-y-4">
66
  <h2 className="text-3xl font-bold">@{user?.userName} channels</h2>
67
- <p>Don&apos;t see your channel? try to <Button onClick={() => login("/account")}>synchronize</Button> again.</p>
68
-
 
 
 
69
  {userChannels?.length ? <ChannelList
70
  layout="grid"
71
  channels={[
@@ -82,7 +86,12 @@ export function UserAccountView() {
82
  }}
83
  />
84
  : isLoaded ? null : <p>Loading channels owned by @{user?.userName}..</p>}
85
- </div> : <p>To create a channel, comment or like a video please <Button onClick={() => login("/account")}>Login with Hugging Face</Button>.</p>}
 
 
 
 
 
86
  </div>
87
  )
88
  }
 
42
  })
43
  }, [isLoaded, apiKey, userChannels.map(c => c.id).join(","), setUserChannels, setLoaded])
44
 
45
+ const showSecretFeature = user?.userName.startsWith("jbilcke")
46
+
47
  return (
48
  <div className={cn(`flex flex-col space-y-4`)}>
49
 
50
+ <div className="flex flex-row space-x-2 items-center">
51
+ {showSecretFeature
52
+ ? <label className="flex w-64">Save videos to my HF account</label>
53
+ : <label className="flex w-64">Note: currently only the API login mode is working.</label>}
 
54
  <Input
55
  placeholder="Hugging Face token (with WRITE access)"
56
  type="password"
 
60
  }}
61
  value={longStandingApiKey}
62
  />
63
+ </div>
64
 
65
  {apiKey ?
66
  <div className="flex flex-col space-y-4">
67
  <h2 className="text-3xl font-bold">@{user?.userName} channels</h2>
68
+ {showSecretFeature
69
+ ? <p>Don&apos;t see your channel? try to <Button onClick={() => login("/account")}>synchronize</Button> again.</p>
70
+ : null
71
+ }
72
+
73
  {userChannels?.length ? <ChannelList
74
  layout="grid"
75
  channels={[
 
86
  }}
87
  />
88
  : isLoaded ? null : <p>Loading channels owned by @{user?.userName}..</p>}
89
+ </div> :
90
+ (
91
+ showSecretFeature
92
+ ? <p>To create a channel, comment or like a video please <Button onClick={() => login("/account")}>Login with Hugging Face</Button>.</p>
93
+ : null)
94
+ }
95
  </div>
96
  )
97
  }