mirror of
https://github.com/franjsco/tomadoro
synced 2025-06-06 00:29:13 +02:00
Add dynamic title (timer)
This commit is contained in:
@@ -8,6 +8,7 @@ import './Timer.css';
|
|||||||
class Timer extends Component {
|
class Timer extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
this.appName = 'tomadoro';
|
||||||
this.state = {
|
this.state = {
|
||||||
seconds: 0,
|
seconds: 0,
|
||||||
started: false,
|
started: false,
|
||||||
@@ -46,6 +47,8 @@ class Timer extends Component {
|
|||||||
seconds: state.seconds - 1
|
seconds: state.seconds - 1
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
document.title=`(${this.formatMinute(this.state.seconds)}) ${this.appName}`;
|
||||||
|
|
||||||
if (this.state.seconds === 0) {
|
if (this.state.seconds === 0) {
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
this.finishedTimer();
|
this.finishedTimer();
|
||||||
@@ -74,6 +77,8 @@ class Timer extends Component {
|
|||||||
} else {
|
} else {
|
||||||
this.pomodoroMode();
|
this.pomodoroMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = this.appName;
|
||||||
}
|
}
|
||||||
|
|
||||||
finishedTimer() {
|
finishedTimer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user