Fix events stuff with awful hacks

This commit is contained in:
Jonathan Cremin 2015-08-08 20:37:49 +01:00
parent b48a4e92e1
commit ab49c181e7
8 changed files with 60 additions and 52 deletions

View file

@ -1,5 +1,4 @@
import path from 'path';
import spdy from 'spdy';
import koa from 'koa';
import route from 'koa-route';
import views from 'koa-views';
@ -153,18 +152,9 @@ app.use(route.get('/updaters/mac/changelog', function() {
}));
if (!module.parent) {
if (process.env.LOCALHOST_KEY) {
spdy.createServer({
key: process.env.LOCALHOST_KEY,
cert: process.env.LOCALHOST_CRT
}, app.callback()).listen(4041, function() {
debug('Koa SPDY server listening on port ' + (process.env.PORT || 4041));
});
} else {
app.listen(process.env.PORT || 4041, function() {
debug('Koa HTTP server listening on port ' + (process.env.PORT || 4041));
});
}
app.listen(process.env.PORT || 4041, function() {
debug('Koa HTTP server listening on port ' + (process.env.PORT || 4041));
});
}
export default app;

View file

@ -22,7 +22,7 @@ var app = angular.module('hostr', [
app.factory('FileService', ['$resource', '$cacheFactory', FileService.factory]);
app.factory('UserService', ['$resource', UserService.factory]);
app.factory('EventService', ['$rootScope', ReconnectingWebSocket, EventService.factory]);
app.factory('EventService', ['$rootScope', 'WebSocket', EventService.factory]);
app.factory('TransactionService', ['$resource', '$cacheFactory', TransactionService.factory]);
app.factory('SettingService', ['$http', SettingService.factory]);
@ -38,7 +38,6 @@ app.directive('searchShortcut', ['$document', searchShortcut]);
app.directive('stripeSubscribe', ['$http', stripeSubscribe]);
app.config(['$routeProvider', '$locationProvider', '$httpProvider', '$tooltipProvider', function($routeProvider, $locationProvider, $httpProvider, $tooltipProvider) {
$tooltipProvider.defaults.template = '/jspm_packages/npm/angular-strap@2.1.2/src/tooltip/tooltip.tpl.html';
if (typeof window.user !== 'undefined') {

View file

@ -1,5 +1,5 @@
export class FilesController {
constructor($scope, UserService, files) {
constructor($scope, UserService, EventService, files) {
$scope.$root.user = UserService.get();
files.$promise.then(function() {
$scope.$root.loadingView = false;
@ -22,7 +22,7 @@ export class FilesController {
};
}
}
FilesController.$inject = ['$scope', 'UserService', 'files'];
FilesController.$inject = ['$scope', 'UserService', 'EventService', 'files'];
export class FileController {
constructor ($scope, $rootScope, $routeParams, ReconnectingWebSocket, file) {