mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
push -> concat
This commit is contained in:
parent
cd9fead87a
commit
0012fbb4d1
@ -133,7 +133,7 @@ export default function AccessTokens() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getAccessTokens();
|
getAccessTokens();
|
||||||
}, [tokens]);
|
}, []);
|
||||||
|
|
||||||
async function handleDeleteToken(token) {
|
async function handleDeleteToken(token) {
|
||||||
try {
|
try {
|
||||||
@ -147,8 +147,7 @@ export default function AccessTokens() {
|
|||||||
async function handleSaveToken(name: string, scopes: string[]) {
|
async function handleSaveToken(name: string, scopes: string[]) {
|
||||||
try {
|
try {
|
||||||
const newToken = await fetchData(CREATE_ACCESS_TOKEN, { method: 'POST', data: { name: name, scopes: scopes } });
|
const newToken = await fetchData(CREATE_ACCESS_TOKEN, { method: 'POST', data: { name: name, scopes: scopes } });
|
||||||
tokens.push(newToken);
|
setTokens(tokens.concat(newToken));
|
||||||
setTokens(tokens);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error);
|
handleError(error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user