Skip to content

Commit

Permalink
chore: extracted generateUniqueKey
Browse files Browse the repository at this point in the history
  • Loading branch information
MSchmoecker committed May 22, 2024
1 parent 03a4caf commit d7450e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let data: PageData;
const addRepo = () => {
const generateUniqueKey = () => {
let num = 1;
let key;
Expand All @@ -26,6 +26,12 @@
num++;
} while (data.state.repositories[key]);
return key;
};
const addRepo = () => {
let key = generateUniqueKey();
data.state.repositories = {
...data.state.repositories,
[key]: {
Expand Down

0 comments on commit d7450e2

Please sign in to comment.