Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 function fileToKey(fileName) | 22 function fileToKey(fileName) |
23 { | 23 { |
24 return keyPrefix + fileName; | 24 return keyPrefix + fileName; |
25 } | 25 } |
26 | 26 |
27 function loadFile(fileName) | 27 function loadFile(fileName) |
28 { | 28 { |
29 return new Promise((resolve, reject) => | 29 return new Promise((resolve, reject) => |
30 { | 30 { |
31 console.trace(); | |
Sebastian Noack
2017/08/24 17:11:00
Did you forget to remove this?
Oleksandr
2017/08/24 17:17:04
Whoops. Yes, sorry. Some of the refreshes before c
| |
32 localforage.getItem(fileToKey(fileName), (err, value) => | 31 localforage.getItem(fileToKey(fileName), (err, value) => |
33 { | 32 { |
34 if (err || value == null) | 33 if (err || value == null) |
35 reject({type: "NoSuchFile"}); | 34 reject({type: "NoSuchFile"}); |
36 else | 35 else |
37 resolve(value); | 36 resolve(value); |
38 }); | 37 }); |
39 }); | 38 }); |
40 } | 39 } |
41 | 40 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 lastModified: entry.lastModified | 156 lastModified: entry.lastModified |
158 }; | 157 }; |
159 }).catch(error => | 158 }).catch(error => |
160 { | 159 { |
161 if (error.type == "NoSuchFile") | 160 if (error.type == "NoSuchFile") |
162 return {exists: false}; | 161 return {exists: false}; |
163 throw error; | 162 throw error; |
164 }); | 163 }); |
165 } | 164 } |
166 }; | 165 }; |
LEFT | RIGHT |