Skip to content

Commit

Permalink
fix: make uncategorized notification less aggressive
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 5, 2023
1 parent cf74080 commit 2bcd615
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/UncategorizedNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ export default {
? this.uncategorizedDuration[0] / this.uncategorizedDuration[1]
: 0;
},
total() {
return this.uncategorizedDuration ? this.uncategorizedDuration[1] : 0;
},
isVisible() {
// if ratio is > 0.3, show it // TODO: make configurable
// TODO: make configurable?
// if total duration is less than 1 hour, don't show it
const overTotal = this.total > 60 * 60 * 1000;
// if ratio is > 0.3, show it
const overRatio = this.ratio > 0.3;
// if there's a category filter (url has category query param), don't show it
return this.ratio > 0.3 && !this.$route.query.category;
const hasCategoryFilter = this.$route.query.category;
return overTotal && overRatio && !hasCategoryFilter;
},
},
};
Expand Down

1 comment on commit 2bcd615

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.3b3 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.3b3 (click to expand)

Please sign in to comment.