Commit 78223ba0 authored by Denton Liu's avatar Denton Liu

Changed SOL_CACHE_FILE within the callback

parent 1bd0dbb1
...@@ -28,8 +28,9 @@ function Editor (loadingFromGist, storage) { ...@@ -28,8 +28,9 @@ function Editor (loadingFromGist, storage) {
this.uploadFile = function (file, callback) { this.uploadFile = function (file, callback) {
var fileReader = new FileReader(); var fileReader = new FileReader();
SOL_CACHE_FILE = utils.fileKey(file.name); var cacheName = utils.fileKey(file.name);
fileReader.onload = function (e) { fileReader.onload = function (e) {
SOL_CACHE_FILE = cacheName;
storage.set(SOL_CACHE_FILE, e.target.result); storage.set(SOL_CACHE_FILE, e.target.result);
sessions[SOL_CACHE_FILE] = null; sessions[SOL_CACHE_FILE] = null;
callback(); callback();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment