1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-29 17:50:09 +02:00

add comments

This commit is contained in:
Kushagra Gour
2019-03-08 13:42:54 +05:30
parent edf71ce296
commit 8b15c479f4
2 changed files with 13 additions and 0 deletions

View File

@@ -206,6 +206,9 @@ export default class App extends Component {
// For web app environment we don't fetch item from localStorage,
// because the item isn't stored in the localStorage.
if (lastCode.id && window.IS_EXTENSION) {
// In case of already saved item (with id), we fetch it from
// its real key instead of using `code` for better reliability.
// because `code` sets only on shady unloadbefore.
db.local.get(lastCode.id, itemResult => {
if (itemResult[lastCode.id]) {
log('Load item ', lastCode.id);
@@ -466,6 +469,7 @@ export default class App extends Component {
/**
* Fetches all items from storage
* @param {boolean} shouldSaveGlobally Whether to store the fetched items in global arr for later use.
* @param {boolean} shouldFetchLocally Intentionally get local items. Used when importing local items to account.
* @return {promise} Promise.
*/
async fetchItems(shouldSaveGlobally, shouldFetchLocally) {