diff --git a/app/js/index.js b/app/js/index.js index 41dc6a8d..485ed83e 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -43,16 +43,18 @@ } if (notification.event && notification.event === 'unlock') { - $('[data-file="' + notification.file + '"].js-unlock').hide(); - $('[data-file="' + notification.file + '"].js-lock').show(); + let file = notification.file.replace(/\\/g, '\\\\'); + $('[data-file="' + file + '"].js-unlock').hide(); + $('[data-file="' + file + '"].js-lock').show(); let text = 'not locked'; - $('[data-file="' + notification.file + '"]').parent().prev().text(text); + $('[data-file="' + file + '"]').parent().prev().text(text); } if (notification.event && notification.event === 'lock') { - $('[data-file="' + notification.file + '"].js-lock').hide(); - $('[data-file="' + notification.file + '"].js-unlock').show(); + let file = notification.file.replace(/\\/g, '\\\\'); + $('[data-file="' + file + '"].js-lock').hide(); + $('[data-file="' + file + '"].js-unlock').show(); let text = notification.data.owner.name + ' (id: ' + notification.data.id + ')'; - $('[data-file="' + notification.file + '"]').parent().prev().text(text); + $('[data-file="' + file + '"]').parent().prev().text(text); } });