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(() => {
|
||||
getAccessTokens();
|
||||
}, [tokens]);
|
||||
}, []);
|
||||
|
||||
async function handleDeleteToken(token) {
|
||||
try {
|
||||
@ -147,8 +147,7 @@ export default function AccessTokens() {
|
||||
async function handleSaveToken(name: string, scopes: string[]) {
|
||||
try {
|
||||
const newToken = await fetchData(CREATE_ACCESS_TOKEN, { method: 'POST', data: { name: name, scopes: scopes } });
|
||||
tokens.push(newToken);
|
||||
setTokens(tokens);
|
||||
setTokens(tokens.concat(newToken));
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user