kinabalu / obsidian-word-sprint

Obsidian Word Sprint plugin
MIT License
41 stars 6 forks source link

View Stats needs next and previous sprint #31

Closed MalignantCarp closed 2 years ago

MalignantCarp commented 2 years ago

So this bit of code here:

    showEndOfSprintStatsModal() {
        if (this.theSprint.isStarted()) {
            new EndOfSprintStatsModal(this.app, this.theSprint.getStats()).open()
        } else if (this.sprintHistory.length > 0) {
            new EndOfSprintStatsModal(this.app, this.sprintHistory[0]).open()
        } else {
            new Notice("No stats found to show!")
        }
    }

If there is no running sprint, then we show the first sprint in the history. So we'll need to either change that to show the last (I don't know if -1 is available like in Python?) or add a next a previous button to scoot through the different sprints.

kinabalu commented 2 years ago

Done.