mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 10:34:18 +00:00
apply default values
This commit is contained in:
parent
d3a752c820
commit
c949eea9ac
@ -130,7 +130,11 @@ export default async function apply(pkg_id, changes) {
|
||||
|
||||
if (changes.configs) {
|
||||
if (!pkg.storaged_configs) {
|
||||
pkg.storaged_configs = {}
|
||||
pkg.storaged_configs = Object.entries(pkg.configs).reduce((acc, [key, value]) => {
|
||||
acc[key] = value.default
|
||||
|
||||
return acc
|
||||
}, {})
|
||||
}
|
||||
|
||||
if (Object.keys(changes.configs).length !== 0) {
|
||||
@ -142,9 +146,9 @@ export default async function apply(pkg_id, changes) {
|
||||
|
||||
await updateInstalledPackage(pkg)
|
||||
|
||||
sendToRender(`new:notification`, {
|
||||
type: "success",
|
||||
message: "Changes applied!",
|
||||
sendToRender(`new:message`, {
|
||||
type: "info",
|
||||
message: "Changes applied",
|
||||
})
|
||||
|
||||
sendToRender(`pkg:update:status`, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user