fix(plugins/settings.plugins): don't restore default repo multiple times

This commit is contained in:
PalmDevs 2026-07-29 21:40:44 +07:00
parent 49c1b1e68d
commit 0c9cd9f8e3
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -4,6 +4,7 @@ import {
setRepos,
} from '@revenge-mod/plugins/_/repositories'
import { noop } from '@revenge-mod/utils/callback'
import { api } from '.'
import type { Repo, RepoConfigEntry } from '@revenge-mod/plugins/_/repositories'
export async function addDefaultRepoIfNeeded() {
@ -21,6 +22,8 @@ export async function addDefaultRepoIfNeeded() {
...userRepos,
])
await api.jsonStorage.set({ defaultRepoRestored: true }).catch(noop)
await refreshRepo(__BUILD_DEFAULT_PLUGIN_REPOSITORY_URL__).catch(noop)
}