Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch mode #43

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ dv.table(
| --pomodoro-timer-text-color | var(--text-normal) |
| --pomodoro-timer-dot-color | var(--color-ted) |

## FAQ

1. How to Switch the Session

To switch sessions, simply click on the `Work/Break` label displayed on the timer.

---

[<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="BuyMeACoffee" width="150">](https://www.buymeacoffee.com/eatgrass)
1 change: 0 additions & 1 deletion src/StatusBarComponent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const ctxMenu = (e: MouseEvent) => {
menu.addItem((item) => {
const mode = `Switch ${$store.mode === 'WORK' ? 'Break' : 'Work'} `
item.setTitle(mode)
item.setDisabled($store.running || $store.inSession)
item.onClick(() => {
store.toggleMode()
})
Expand Down
3 changes: 0 additions & 3 deletions src/Timer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ export default class Timer implements Readable<TimerStore> {

public toggleMode(callback?: (state: TimerState) => void) {
this.update((s) => {
if (s.inSession) {
return s
}
let updated = this.endSession(s)
if (callback) {
callback(updated)
Expand Down
2 changes: 1 addition & 1 deletion src/TimerViewComponent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const toggleExtra = (value: 'settings' | 'tasks') => {
<div class="timer">
<div class="timer-display">
<div
class="status {$timer.inSession ? '' : 'control'}"
class="status control"
on:click={toggleMode}
>
{#if $timer.running}<span class="breath"></span>{/if}
Expand Down