Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Naifu Frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Naifu Frontend
Commits
8e0ddd3c
Commit
8e0ddd3c
authored
Oct 17, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add backend token
parent
14321074
Pipeline
#17218
failed with stages
in 2 minutes and 24 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
5 deletions
+10
-5
next.config.js
next.config.js
+1
-0
src/components/nonaccountbanner.tsx
src/components/nonaccountbanner.tsx
+2
-1
src/components/trialactions.tsx
src/components/trialactions.tsx
+3
-2
src/globals/constants.ts
src/globals/constants.ts
+1
-0
src/globals/state.ts
src/globals/state.ts
+2
-1
src/hooks/useLogout.ts
src/hooks/useLogout.ts
+1
-1
No files found.
next.config.js
View file @
8e0ddd3c
...
...
@@ -52,6 +52,7 @@ const sharedConfig = {
NEXT_PUBLIC_PADDLE_GIFTKEY_TABLET_ID
:
process
.
env
.
NOVELAI_PADDLE_GIFTKEY_TABLET_ID
,
NEXT_PUBLIC_PADDLE_GIFTKEY_SCROLL_ID
:
process
.
env
.
NOVELAI_PADDLE_GIFTKEY_SCROLL_ID
,
NEXT_PUBLIC_PADDLE_GIFTKEY_OPUS_ID
:
process
.
env
.
NOVELAI_PADDLE_GIFTKEY_OPUS_ID
,
NEXT_PUBLIC_TOKEN
:
process
.
env
.
NOVELAI_TOKEN
,
},
productionBrowserSourceMaps
:
true
,
generateBuildId
:
()
=>
commithash
.
slice
(
0
,
7
)
+
'
-
'
+
process
.
env
.
NOVELAI_ENVIRONMENT
,
...
...
src/components/nonaccountbanner.tsx
View file @
8e0ddd3c
...
...
@@ -5,6 +5,7 @@ import { SubtleButton } from '../styles/ui/button'
import
{
Session
,
SiteTheme
}
from
'
../globals/state
'
import
{
User
}
from
'
../data/user/user
'
import
{
Dark
}
from
'
../styles/themes/dark
'
import
{
BackendToken
}
from
'
../globals/constants
'
export
const
BannerContent
=
styled
.
div
`
color:
${(
props
)
=>
props
.
theme
.
colors
.
textHeadings
}
;
...
...
@@ -31,7 +32,7 @@ export function NonAccountBanner(): JSX.Element {
<
Link
href=
"/register"
passHref
>
<
SubtleButton
onClick=
{
()
=>
{
setSession
(
new
User
(
''
,
''
))
setSession
(
new
User
(
BackendToken
,
''
))
setTheme
(
Dark
)
}
}
color=
{
'
#D9FFE1
'
}
...
...
src/components/trialactions.tsx
View file @
8e0ddd3c
...
...
@@ -17,6 +17,7 @@ import { InvertedButton, SubtleButton } from '../styles/ui/button'
import
{
InkIcon
}
from
'
../styles/ui/icons
'
import
{
FlexCol
,
FlexColSpacer
}
from
'
../styles/ui/layout
'
import
{
getLocalStorage
,
setLocalStorage
}
from
'
../util/storage
'
import
{
BackendToken
}
from
'
../globals/constants
'
import
Modal
,
{
ModalType
}
from
'
./modals/modal
'
import
{
CloseButton
}
from
'
./modals/common
'
import
{
UpdateNotifierBackground
,
UpdateNotifierOverlay
,
UpdateNotifierText
}
from
'
./updatenotifier
'
...
...
@@ -174,7 +175,7 @@ export function CreateAccountPrompt(): JSX.Element {
<
Link
href=
"/register"
passHref
>
<
InvertedButton
onClick=
{
()
=>
{
setSession
(
new
User
(
''
,
''
))
setSession
(
new
User
(
BackendToken
,
''
))
setTheme
(
Dark
)
}
}
style=
{
{
justifyContent
:
'
center
'
,
flex
:
1
,
width
:
'
100%
'
,
fontWeight
:
700
}
}
...
...
@@ -297,7 +298,7 @@ export function IPLimitPrompt(): JSX.Element {
<
Link
href=
"/register"
passHref
>
<
InvertedButton
onClick=
{
()
=>
{
setSession
(
new
User
(
''
,
''
))
setSession
(
new
User
(
BackendToken
,
''
))
setTheme
(
Dark
)
}
}
style=
{
{
justifyContent
:
'
center
'
,
flex
:
1
,
width
:
'
100%
'
,
fontWeight
:
700
}
}
...
...
src/globals/constants.ts
View file @
8e0ddd3c
...
...
@@ -4,6 +4,7 @@ export const CommitHash = process.env.NEXT_PUBLIC_COMMITHASH || 'unknown'
export
const
SentryDSN
=
process
.
env
.
NEXT_PUBLIC_SENTRY_DSN
||
''
export
const
BackendURL
=
process
.
env
.
NEXT_PUBLIC_BACKEND_URL
||
''
export
const
BackendToken
=
process
.
env
.
NEXT_PUBLIC_BACKEND_TOKEN
||
''
export
const
MockEnv
=
process
.
env
.
NEXT_PUBLIC_MOCK_ENV
===
'
true
'
export
const
RecaptchaKey
=
process
.
env
.
NEXT_PUBLIC_RECAPTCHA_KEY
||
''
export
const
PaddleSandbox
=
process
.
env
.
NEXT_PUBLIC_PADDLE_SANDBOX
===
'
true
'
...
...
src/globals/state.ts
View file @
8e0ddd3c
...
...
@@ -13,6 +13,7 @@ import { StoryMode } from '../data/story/story'
import
{
DefaultModel
,
TextGenerationModel
}
from
'
../data/request/model
'
import
{
PlatformImageData
}
from
'
../compatibility/platformtypes
'
import
{
GlobalUserContext
}
from
'
./globals
'
import
{
BackendToken
}
from
'
./constants
'
class
LastResponseData
{
tokens
:
number
[]
=
new
Array
<
number
>
()
...
...
@@ -22,7 +23,7 @@ class LastResponseData {
export
const
Session
=
atom
({
key
:
'
session
'
,
default
:
new
User
(
''
,
''
),
default
:
new
User
(
BackendToken
,
''
),
})
export
const
SessionValue
=
selectorFamily
({
...
...
src/hooks/useLogout.ts
View file @
8e0ddd3c
...
...
@@ -20,7 +20,7 @@ export const useLogout = (): (() => void) => {
set
(
SelectedStory
,
{
loaded
:
false
,
id
:
''
})
set
(
Stories
,
[])
set
(
LastContextReport
,
new
ContextReport
())
set
(
Session
,
new
User
(
''
,
''
))
set
(
Session
,
new
User
(
BackendToken
,
''
))
GlobalUserContext
.
keystore
=
new
KeyStore
()
GlobalUserContext
.
remoteStories
=
new
Set
()
GlobalUserContext
.
stories
=
new
Map
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment