Skip to content

Commit

Permalink
Fix loading screen info
Browse files Browse the repository at this point in the history
  • Loading branch information
Ives van Hoorne committed Dec 20, 2017
1 parent 14cf290 commit df66855
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/sandbox/npm/fetch-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default async function fetchDependencies(npmDependencies: Dependencies) {

try {
const result = await getDependencies(npmDependencies);
setScreen({ type: 'loading', text: 'Transpiling...' });
setScreen({ type: 'loading', text: 'Transpiling Modules...' });

return result;
} catch (e) {
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/sandbox/npm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export default async function loadDependencies(dependencies: NPMDependencies) {

const data = await fetchDependencies(dependenciesWithoutTypings);
manifest = data;

setScreen({ type: 'loading', text: 'Downloading Dependencies...' });
}
} else {
manifest = null;
Expand Down
8 changes: 5 additions & 3 deletions packages/app/src/sandbox/status-screen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function changeText(text: string) {
}
}

function createOverlay(text: string) {
function createOverlay() {
return new Promise(resolve => {
const iframe = document.createElement('iframe');

Expand All @@ -35,7 +35,9 @@ function createOverlay(text: string) {
iframe.contentDocument.body.innerHTML = loadingHtml;
iframeReference = iframe;

changeText(text);
if (currentScreen) {
changeText(currentScreen.text);
}
resolve();
};

Expand All @@ -59,7 +61,7 @@ export default function setScreen(screen: Screen) {
// Give the illusion of faster loading by showing the loader screen later
firstLoaded = setTimeout(() => {
if (currentScreen) {
createOverlay(currentScreen.text);
createOverlay();
}
}, 600);
} else {
Expand Down

0 comments on commit df66855

Please sign in to comment.