mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-26 09:27:30 +00:00
Fix default setting merge
This commit is contained in:
parent
3c99c040ee
commit
0b178fc7a0
@ -33,8 +33,8 @@ class User {
|
|||||||
|
|
||||||
getSettingsOrDefaults() {
|
getSettingsOrDefaults() {
|
||||||
const settings = this.getSettings()
|
const settings = this.getSettings()
|
||||||
for (const key of Object.keys(settings)) {
|
for (const key of Object.keys(constants.user_settings)) {
|
||||||
if (settings[key] === null) settings[key] = constants.user_settings[key].default
|
if (settings[key] == null) settings[key] = constants.user_settings[key].default
|
||||||
}
|
}
|
||||||
return settings
|
return settings
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ const fetch = require("node-fetch")
|
|||||||
const db = require("./db")
|
const db = require("./db")
|
||||||
|
|
||||||
async function fetchChannel(ucid, instance) {
|
async function fetchChannel(ucid, instance) {
|
||||||
|
if (!instance) throw new Error("No instance parameter provided")
|
||||||
// fetch
|
// fetch
|
||||||
const channel = await fetch(`${instance}/api/v1/channels/${ucid}`).then(res => res.json())
|
const channel = await fetch(`${instance}/api/v1/channels/${ucid}`).then(res => res.json())
|
||||||
// update database
|
// update database
|
||||||
|
Loading…
Reference in New Issue
Block a user