Added stream URL to channel settings.

This commit is contained in:
rainbow napkin 2025-05-10 22:07:20 -04:00
parent e4bebce431
commit 93265b7890
6 changed files with 92 additions and 14 deletions

View file

@ -235,13 +235,28 @@ class prefrenceList{
}
async submitUpdate(event){
//Get key from event target
const key = event.target.id.replace("channel-preference-","");
const value = event.target.checked;
//Pull value from event target
let value = event.target.value;
//If this is a checkmark
if(event.target.type == "checkbox"){
//Use the .checked property instead of .value
value = event.target.checked;
}
//Create settings map
const settingsMap = new Map([
[key, value]
]);
this.handleUpdate(await utils.ajax.setChannelSetting(this.channel, settingsMap), event.target, key);
//Send update and collect results
const update = await utils.ajax.setChannelSetting(this.channel, settingsMap);
//Handle update from server
this.handleUpdate(update, event.target, key);
}
handleUpdate(data, target, key){