Fix the webworker app
This commit is contained in:
@@ -815,7 +815,6 @@ define([
|
||||
store.proxy = rt.proxy;
|
||||
store.loggedIn = typeof(data.userHash) !== "undefined";
|
||||
|
||||
var returned = {};
|
||||
rt.proxy.on('create', function (info) {
|
||||
store.realtime = info.realtime;
|
||||
store.network = info.network;
|
||||
@@ -858,7 +857,8 @@ define([
|
||||
Store.init = function (data, callback) {
|
||||
if (initialized) {
|
||||
return void callback({
|
||||
error: 'ALREADY_INIT'
|
||||
state: 'ALREADY_INIT',
|
||||
returned: store.returned
|
||||
});
|
||||
}
|
||||
initialized = true;
|
||||
@@ -873,6 +873,7 @@ define([
|
||||
if (Object.keys(store.proxy).length === 1) {
|
||||
Feedback.send("FIRST_APP_USE", true);
|
||||
}
|
||||
store.returned = ret;
|
||||
|
||||
callback(ret);
|
||||
|
||||
|
||||
31
www/common/outer/store-worker.js
Normal file
31
www/common/outer/store-worker.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var window = self;
|
||||
importScripts('/bower_components/requirejs/require.js');
|
||||
|
||||
require.config({
|
||||
// fix up locations so that relative urls work.
|
||||
baseUrl: '/',
|
||||
paths: {
|
||||
// jquery declares itself as literally "jquery" so it cannot be pulled by path :(
|
||||
"jquery": "/bower_components/jquery/dist/jquery.min",
|
||||
// json.sortify same
|
||||
"json.sortify": "/bower_components/json.sortify/dist/JSON.sortify",
|
||||
//"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf",
|
||||
//"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker"
|
||||
cm: '/bower_components/codemirror'
|
||||
},
|
||||
map: {
|
||||
'*': {
|
||||
'css': '/bower_components/require-css/css.js',
|
||||
'less': '/common/RequireLess.js',
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onconnect = function(e) {
|
||||
var port = e.ports[0];
|
||||
port.postMessage({state: 'READY'});
|
||||
port.onmessage = function (e) {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user