mirror of
https://github.com/microsoft/Web-Dev-For-Beginners.git
synced 2025-08-10 00:36:43 +02:00
remove regionName Keyword
This commit is contained in:
committed by
Sara Gibbons
parent
207136a537
commit
81a152ed88
@@ -67,14 +67,14 @@ const displayCarbonUsage = async (apiKey, region) => {
|
||||
};
|
||||
|
||||
// set up api key and region
|
||||
const setUpUser = async (apiKey, regionName) => {
|
||||
const setUpUser = async (apiKey, region) => {
|
||||
localStorage.setItem('apiKey', apiKey);
|
||||
localStorage.setItem('regionName', regionName);
|
||||
localStorage.setItem('region', region);
|
||||
loading.style.display = 'block';
|
||||
errors.textContent = '';
|
||||
clearBtn.style.display = 'block';
|
||||
//make initial call
|
||||
displayCarbonUsage(apiKey, regionName);
|
||||
displayCarbonUsage(apiKey, region);
|
||||
};
|
||||
|
||||
// handle form submission
|
||||
@@ -87,7 +87,7 @@ const handleSubmit = async (e) => {
|
||||
const init = async () => {
|
||||
//if anything is in localStorage, pick it up
|
||||
const storedApiKey = localStorage.getItem('apiKey');
|
||||
const storedRegion = localStorage.getItem('regionName');
|
||||
const storedRegion = localStorage.getItem('region');
|
||||
|
||||
//set icon to be generic green
|
||||
chrome.runtime.sendMessage({
|
||||
@@ -116,7 +116,7 @@ const init = async () => {
|
||||
const reset = async (e) => {
|
||||
e.preventDefault();
|
||||
//clear local storage for region only
|
||||
localStorage.removeItem('regionName');
|
||||
localStorage.removeItem('region');
|
||||
init();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user