1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-13 18:16:19 +02:00

add alert for writefile error

This commit is contained in:
Kushagra Gour
2017-05-31 02:28:36 +05:30
parent be10b1b56d
commit 806bf386a8

View File

@ -772,6 +772,13 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl, fontStyleTag, fontStyl
function errorHandler() {
utils.log(arguments);
trackEvent('fn', 'error', 'writeFile');
// When there are too many write errors, show a message.
writeFile.errorCount = (writeFile.errorCount || 0) + 1;
if (writeFile.errorCount === 10) {
setTimeout(function () {
alert('Oops! Seems like your preview isn\'t updating. Please try the following steps until it fixes:\n - Refresh Web Maker\n - Restart Chrome browser\n - Reinstall Web Maker (don\'t forget to export all your creations from saved items pane (click the OPEN button) before reinstalling)\n\nIf nothing works, please tweet out to @webmakerApp.');
}, 1000)
}
}
// utils.log('writing file ', name);