Added stream URL to channel settings.
This commit is contained in:
parent
e4bebce431
commit
93265b7890
6 changed files with 92 additions and 14 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue