Skip to content

Commit

Permalink
feat: losses to NPCs are now hidden from lists and stats
Browse files Browse the repository at this point in the history
  • Loading branch information
juzraai committed Apr 4, 2021
1 parent 7207c67 commit dcc0811
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
// TODO app logo, brand, favicon
// TODO bar chart options for day limit: 10, 15, 21, 30
// TODO mark amount of paid losses in bar chart by stacking bars?
// TODO "Hide" button: exclude losses from top widgets and Unpaid tab, on other tabs it can be with lighter font color. grouping should consider "hidden" flag too
// TODO "Hide" button: exclude losses from top widgets and Clients/Unpaid tabs. on other tabs it can be with lighter font color, without Paid button but with Unhide. grouping should consider "hidden" flag too
// TODO display about and changelog markdown files in app
// TODO display changelog in modal dialog if version is newer than previously stored
import Footer from "@/components/Footer.vue";
import Navbar from "@/components/Navbar.vue";
Expand Down
10 changes: 8 additions & 2 deletions src/components/RefreshWidget.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<template>
<Widget card-class="alert-info">
<h6 class="card-title">
<strong>{{ losses.length }}</strong>
<strong
title="This includes losses to NPCs too."
v-b-tooltip.hover.top
>{{ losses.length }}</strong>
losses between
</h6>
<p class="flex-grow-1" v-if="losses.length">
<p
class="flex-grow-1"
v-if="losses.length"
>
{{ formatTimestamp(losses[0].timestamp_ended) }}
<br>
{{ formatTimestamp(losses[losses.length - 1].timestamp_ended) }}
Expand Down
11 changes: 11 additions & 0 deletions src/services/npcList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const NPC_LIST = [
4, // Duke
7, // Amanda
10, // Scrooge
15, // Leslie
17, // Easter Bunny
19, // Jimmy
20, // Fernando
]

export default NPC_LIST
5 changes: 3 additions & 2 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import moment from "moment"
import Vue from 'vue'
import Vuex from 'vuex'
import npcList from '../services/npcList'
import storage from '../services/storage'
import tornApi from '../services/tornApi.js'
import tornApi from '../services/tornApi'

Vue.use(Vuex)

Expand Down Expand Up @@ -69,7 +70,7 @@ const store = new Vuex.Store({
a.oldest = i === state.losses.length - 1
a.paid = state.paidUntil[a.defender_id] >= a.timestamp_ended
return a
})
}).filter(a => !npcList.includes(a.defender_id))
},
days(_, getters) {
return getters.losses.reduce((days, a) => {
Expand Down

0 comments on commit dcc0811

Please sign in to comment.