Protect against multiple windows when delete a file from recovery

This commit is contained in:
benweet 2013-11-03 11:37:55 +00:00
parent 4a2d80d5e9
commit f11de7259e

View File

@ -65,6 +65,8 @@
function removeFile(fileIndex) {
var ok = confirm('Are you sure you want to remove "' + localStorage[fileIndex + '.title'] + '"?');
if(ok) {
// Protect against multiple windows
localStorage.removeItem('frontWindowId');
localStorage['file.list'] = localStorage['file.list'].replace(';' + fileIndex + ';', ';');
for (var key in localStorage){
key.indexOf(fileIndex) === 0 && localStorage.removeItem(key);