Master/Locl/depracated/cacheManager.js
//	- Need to have a larger JSON for Stores, so we can differentiate incase other caching is needed 
Need to have a larger JSON for Stores, so we can differentiate incase other caching is needed
Need to have a larger JSON for Stores so we can differentiate incase other caching is needed
async addItem(storeID, visited, favourited, meaningful, lastVisited) {
	console.log("Adding Store: " + storeID);
	var currentStoreID = storeID.toString();
	var currentVisited = visited.toString();
	var currentFavourited = favourited.toString();
	var currentMeaningful = meaningful.toString();
	var currentLastVisited = lastVisited.toString();
	var currentStoreTime = String(Math.floor(Date.now() / 1000));
	console.log("Current Store Time: " + currentStoreTime);
	try {
		let defaultSet = '{"visited": ' + currentVisited + ', "favourited": ' + currentFavourited +', "meaningful": ' + currentMeaningful + ', "lastVisited": ' + currentStoreTime + ', "lastSale": 0 }';
		await AsyncStorage.setItem(currentStoreID, defaultSet);
		console.log('Saved selection to disk. Meaningful: ' + currentMeaningful + ' Visited: ' + currentVisited + ' Favourited: ' + currentFavourited + ' Last Visited: ' + currentStoreTime);
	} catch (error) {
		console.log('AsyncStorage error when adding item: ' + error.message);
	}
}
async addItem ( storeID , visited , favourited , meaningful , lastVisited ) { console . log ( "Adding Store: " + storeID ) ; var currentStoreID = storeID . toString ( ) ; var currentVisited = visited . toString ( ) ; var currentFavourited = favourited . toString ( ) ; var currentMeaningful = meaningful . toString ( ) ; var currentLastVisited = lastVisited . toString ( ) ; var currentStoreTime = String ( Math . floor ( Date . now ( ) / 1000 ) ) ; console . log ( "Current Store Time: " + currentStoreTime ) ; try { let defaultSet = '{"visited": ' + currentVisited + ', "favourited": ' + currentFavourited + ', "meaningful": ' + currentMeaningful + ', "lastVisited": ' + currentStoreTime + ', "lastSale": 0 }' ; await AsyncStorage . setItem ( currentStoreID , defaultSet ) ; console . log ( 'Saved selection to disk. Meaningful: ' + currentMeaningful + ' Visited: ' + currentVisited + ' Favourited: ' + currentFavourited + ' Last Visited: ' + currentStoreTime ) ; } catch ( error ) { console . log ( 'AsyncStorage error when adding item: ' + error . message ) ; } }
Need to have a larger JSON for Stores, so we can differentiate incase other caching is needed
Need to have a larger JSON for Stores so we can differentiate incase other caching is needed
//Convert arguments to Strings //Get Store time //Add to Cache