From fdc3d066754ccc809267f7982ae31e0b11b1b25d Mon Sep 17 00:00:00 2001 From: dickreckard Date: Wed, 28 May 2014 12:02:01 +0200 Subject: [PATCH] fixed the webapp so it removes non-existing msgs from the cache --- webapp.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/webapp.html b/webapp.html index 70f7a0d..7179cfc 100644 --- a/webapp.html +++ b/webapp.html @@ -114,7 +114,6 @@ function doStuffForEach( entriesString, stuffFunction ) { * INBOX STUFF */ function updateInboxView() { -localStorage.clear(); var contentString = ''; for(var i in localStorage) { @@ -133,21 +132,20 @@ function onMessageDownload( msg, filename ) { updateInboxView(); } function onIndex( index ) { + var lines = index.split( /\n/ ); -/* NON WORKING MOD for(var k in localStorage){ var l = 1; for ( var i in lines ) { - if (i == k){ l = 0; } + var f = lines[i]; + if (f == k){ l = 0; } } if (l == 1){ localStorage.removeItem(k); } } updateInboxView(); -*/ - var lines = index.split( /\n/ ); for ( var i in lines ) { var fname = lines[i]; if ( localStorage.getItem( fname ) === null ) {