UI: Reformat empty payloads

This commit is contained in:
Ilija Lazoroski 2022-07-25 10:47:49 +02:00
parent f4dee02874
commit 674ee02dda
1 changed files with 6 additions and 1 deletions

View File

@ -13,7 +13,12 @@ export function reformatConfig(config, reverse = false) {
}
formattedConfig['keep_tunnel_open_time'] = formattedConfig['advanced']['keep_tunnel_open_time'];
} else {
formattedConfig['payloads'] = formattedConfig['payloads'][0]['options'];
if(formattedConfig['payloads'].length !== 0)
{
formattedConfig['payloads'] = formattedConfig['payloads'][0]['options'];
} else {
formattedConfig['payloads'] = {'encryption': {}, 'other_behaviors': {}}
}
formattedConfig['advanced'] = {};
formattedConfig['advanced']['keep_tunnel_open_time'] = formattedConfig['keep_tunnel_open_time'];
}