zwrócić wynik asynchroniczny i nie jest niezdefiniowany
function loadJiraUrlElements() {
return new Promise(function(resolve, reject) {
chrome.storage.local.get({companyName: '', jiraBaseUrl: ''}, function(items) {
resolve(items.companyName + items.jiraBaseUrl);
})
});
}
// And caller function changes to
function populateUrlFieldsWithUrlElements(){
loadJiraUrlElements().then(function(value) {
companyInput.value = value;
})
}
Old-fashioned Ocelot