Skip to content

Commit

Permalink
Merge pull request #54 from axelekwall/master
Browse files Browse the repository at this point in the history
Cleaned up functions and added a cleanUp function ;P
  • Loading branch information
axelekwall authored Sep 3, 2018
2 parents 8034ace + c943d30 commit 8e3de76
Show file tree
Hide file tree
Showing 18 changed files with 12,681 additions and 7,936 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,6 @@ GitHub.sublime-settings

/build/*

**/.runtimeconfig.json
**/.runtimeconfig.json

.firebase
2 changes: 1 addition & 1 deletion client/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
8.11.4
15,167 changes: 7,726 additions & 7,441 deletions client/package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"engines": {
"node": "8.9.4",
"npm": "5.6.0"
"node": "8.11.4",
"npm": "6"
},
"scripts": {
"serve": "vue-cli-service serve",
Expand All @@ -13,23 +13,23 @@
},
"dependencies": {
"d3": "^4.13.0",
"firebase": "^4.10.1",
"moment": "^2.21.0",
"firebase": "^4.13.1",
"moment": "^2.22.2",
"particles.js": "^2.0.0",
"vue": "^2.5.13",
"vue": "^2.5.16",
"vue-router": "^3.0.1",
"vue-slider-component": "^2.5.8",
"vue-slider-component": "^2.7.4",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0-beta.3",
"@vue/cli-plugin-eslint": "^3.0.0-beta.3",
"@vue/cli-service": "^3.0.0-beta.3",
"@vue/eslint-config-prettier": "^3.0.0-beta.3",
"@vue/cli-plugin-babel": "^3.0.0-rc.5",
"@vue/cli-plugin-eslint": "^3.0.0-rc.5",
"@vue/cli-service": "^3.0.0-rc.5",
"@vue/eslint-config-prettier": "^3.0.0-rc.5",
"lint-staged": "^6.1.1",
"node-sass": "^4.7.2",
"node-sass": "^4.9.3",
"sass-loader": "^6.0.7",
"vue-template-compiler": "^2.5.13"
"vue-template-compiler": "^2.5.16"
},
"babel": {
"presets": [
Expand Down
23 changes: 0 additions & 23 deletions client/src/components/HelloWorld.vue

This file was deleted.

28 changes: 8 additions & 20 deletions client/src/components/ScatterPlot.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="menuItems">
<a href="javascript:history.go(-1)" class="route_button2">Back</a>
<div>
<div class="menuItems">
<a href="javascript:history.go(-1)" class="route_button2">Back</a>
</div>
<div class="starCount">
<div class="gameName">{{gameName}}</div>
Expand All @@ -11,11 +11,11 @@
<div class="staticHeadline">Viewing this game</div>
<div class="changingValues">{{this.current.games[gameId].totalViewers}}</div>
</div>
<div class="cont">
<div id="chart"></div>
<Slider/>
</div>
</div>
<div class="cont">
<div id="chart"></div>
<Slider/>
</div>
</div>
</template>


Expand All @@ -39,18 +39,6 @@ export default {
this.getGame();
},
computed: {
isSelected() {
if (this.selectedStreamer) {
this.$store
.dispatch('getUserHistory', this.selectedStreamer)
.then(array => {
console.log(array);
});
return true;
} else {
return false;
}
},
gameId() {
return this.$route.params.id;
},
Expand Down
40 changes: 1 addition & 39 deletions client/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export default new Vuex.Store({
starCount: 0,
current: {},
top100: {},
games: {},
users: {}
games: {}
},
mutations: {
setTop100(state, top100) {
Expand All @@ -45,14 +44,8 @@ export default new Vuex.Store({
setStarCount(state, number) {
state.starCount = number;
},
setUsers(state, users) {
state.users = users;
},
addGame(state, gameObj) {
state.games[gameObj.id] = gameObj;
},
setUser(state, obj) {
state.users[obj.id] = obj.userObj;
}
},
actions: {
Expand All @@ -63,34 +56,6 @@ export default new Vuex.Store({
updateStarCount({ commit, state }, timestamp) {
commit("setStarCount", state.top100[timestamp].totalViewers);
},
getUserHistory({ commit, state }, id) {
return new Promise((resolve, reject) => {
if (!state.users[id].history) {
const userHistoryRef = db
.collection("users")
.doc(id)
.collection("daily_average");
userHistoryRef
.get()
.then(snapshot => {
let array = [];
snapshot.forEach(record => {
array.push(record.data());
});
const newUserObj = Object.assign(state.users[id], {
history: array
});
commit("setUser", { userObj: newUserObj, id: id });
resolve(array);
})
.catch(err => {
reject(err);
});
} else {
resolve(state.users[id].history);
}
});
},
getGameInfo({ state, commit }, id) {
return new Promise((resolve, reject) => {
if (!state.games[id]) {
Expand All @@ -116,7 +81,6 @@ export default new Vuex.Store({
commit("toggleLoading", false);
} else {
let top100 = {};
let users = {};
const streamsRef = db.collection("streams");
streamsRef
.orderBy("timestamp", "desc")
Expand All @@ -140,7 +104,6 @@ export default new Vuex.Store({
timestamp: timestamp.toDate()
};
docData.top100.forEach(stream => {
users[stream.user_id] = stream;
if (stream.game_id !== "") {
if (
top100[timestamp.format("YYYYMMDDHHmm")].games[
Expand Down Expand Up @@ -176,7 +139,6 @@ export default new Vuex.Store({
} else {
time.minutes(0);
}
commit("setUsers", users);
commit("setTop100", top100);
commit("setCurrent", state.top100[time.format("YYYYMMDDHHmm")]);
commit("setStarCount", 200000);
Expand Down
2 changes: 1 addition & 1 deletion functions/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.11.3
8.11.4
134 changes: 0 additions & 134 deletions functions/api.js

This file was deleted.

Loading

0 comments on commit 8e3de76

Please sign in to comment.