~15651933282-v/study.cs.ucl-password-collection-clients/study.cs.ucl-password-collection-clients

« back to all changes in this revision

Viewing changes to js/IdbService.js

  • Committer: Steve Dodier-Lazaro
  • Date: 2015-04-13 21:00:28 UTC
  • Revision ID: s.dodier-lazaro@cs.ucl.ac.uk-20150413210028-chc9hyyaed8vhp9i
Fixed entries not being deleted by replacing the hashThis promise with a synchronous hashing

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        ]);
119
119
        getEntryToDeleteRequest.onsuccess = function () {
120
120
            var url = getEntryToDeleteRequest.result['url'];
121
 
            HashingService.hashThis(url).then(function (hashedUrl) {
 
121
            var hashedUrl = HashingService.hashImmediately(url);
 
122
            if (hashedUrl) {
122
123
                var addDeletedEntryRequest = deletedStore.add({
123
124
                    timeDeleted: new Date().getTime(),
124
125
                    time: getEntryToDeleteRequest.result['time'],
143
144
                addDeletedEntryRequest.onerror = function (error) {
144
145
                    console.error("Could not transfer entry into deletedEntries DB: ", error);
145
146
                };
146
 
            });
 
147
            };
147
148
        };
148
149
        getEntryToDeleteRequest.onerror = function (error) {
149
150
            console.error("Could not find entry to delete in DB: ", error);