[lib.channel-controller] fix dump() to clear list before updating
This commit is contained in:
parent
d48d865be6
commit
4e4d80b7bb
|
@ -69,7 +69,7 @@ export default class ChannelController{
|
|||
return false;
|
||||
|
||||
/* (2) Clear list () */
|
||||
this.list.splice();
|
||||
this.list.splice(0);
|
||||
|
||||
/* (3) Apply new channels */
|
||||
for(let c of channels){
|
||||
|
@ -201,11 +201,11 @@ export default class ChannelController{
|
|||
create(name=null, link=null){
|
||||
|
||||
/* (1) Manage invalid @link */
|
||||
if( typeof link !== 'string' || /^[a-z0-9-]$/i.test(link) )
|
||||
if( typeof link !== 'string' )
|
||||
return false;
|
||||
|
||||
/* (2) Manage invalid @name */
|
||||
if( typeof name !== 'string' || !/^[a-z0-9\/_-]{3,}$/i.test(name) )
|
||||
if( typeof name !== 'string' )
|
||||
return false;
|
||||
|
||||
/* (3) Try to create room in API */
|
||||
|
|
|
@ -223,7 +223,7 @@ export default class RoomController{
|
|||
return false;
|
||||
|
||||
/* (2) Manage invalid @name */
|
||||
if( typeof name !== 'string' || !/^[a-z0-9\/_-]{3,}$/i.test(name) )
|
||||
if( typeof name !== 'string' )
|
||||
return false;
|
||||
|
||||
/* (3) Try to create room in API */
|
||||
|
|
Loading…
Reference in New Issue