@ -278,21 +278,23 @@ export default {
} ,
watch : {
recordings ( ) {
this . data = this . recordings
this . data . forEach ( ( recording ) => {
this . data = this . recordings . map ( ( recording ) => {
const recordingCopy = { ... recording }
const user = this . getSubscriber ( )
const userCli = user . primary _number . cc + user . primary _number . ac + user . primary _number . sn
if ( recording . caller ) {
if ( recording . caller === userCli ) {
recording . callerName = this . $t ( 'Me' )
}
if ( recordingCopy . caller && recordingCopy . caller === userCli ) {
recordingCopy . callerName = this . $t ( 'Me' )
}
if ( recording . callee ) {
if ( recording . callee === userCli ) {
recording . calleeName = this . $t ( 'Me' )
}
if ( recordingCopy . callee && recordingCopy . callee === userCli ) {
recordingCopy . calleeName = this . $t ( 'Me' )
}
return recordingCopy
} )
this . rowStatus = this . recordings . map ( ( rec ) => {
return {
id : rec . id ,
@ -373,13 +375,20 @@ export default {
return rowStatus && rowStatus . expanded
} ,
async updateCollapseArray ( id ) {
const recording = this . recordings . filter ( ( rec ) => rec . id === id ) [ 0 ]
/ / F i n d t h e r e c o r d i n g i n o u r l o c a l d a t a c o p y , n o t t h e s t o r e
const recording = this . data . filter ( ( rec ) => rec . id === id ) [ 0 ]
const rowStatus = this . rowStatus . filter ( ( row ) => row . id === id ) [ 0 ]
rowStatus . expanded = ! rowStatus . expanded
if ( rowStatus . expanded && recording . files . length === 0 ) {
this . $wait . start ( ` loading-stream- ${ id } ` )
try {
await this . fetchStreams ( id )
/ / A f t e r f e t c h i n g s t r e a m s , w e n e e d t o u p d a t e o u r l o c a l c o p y
/ / s i n c e t h e s t o r e h a s b e e n u p d a t e d
const updatedRecording = this . recordings . find ( ( rec ) => rec . id === id )
if ( updatedRecording ) {
recording . files = [ ... updatedRecording . files ]
}
} finally {
this . $wait . end ( ` loading-stream- ${ id } ` )
}