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