Skip to content

Commit

Permalink
solve #44
Browse files Browse the repository at this point in the history
delete all
  • Loading branch information
architec committed Dec 18, 2021
1 parent 94aecd9 commit 7d2d094
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pages/Popup/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import AssignmentIcon from '@mui/icons-material/Assignment';
import DeleteIcon from '@mui/icons-material/Delete';
import GitHubIcon from '@mui/icons-material/GitHub';
import AccountTreeIcon from '@mui/icons-material/AccountTree';
import DeleteSweepIcon from '@mui/icons-material/DeleteSweep';
import { ListItemSecondaryAction } from '@mui/material';

// helper functions
Expand Down Expand Up @@ -84,6 +85,11 @@ class Popup extends Component {
);
}

removeall() {
chrome.storage.sync.set({ data: [] });
this.setState({ data: [] });
}

handleSubmit(event) {
alert('Saved the number of days for timer: ' + this.state.daysInput);
chrome.storage.sync.set({ timerDays: this.state.daysInput });
Expand Down Expand Up @@ -183,13 +189,11 @@ class Popup extends Component {
size="large"
aria-label="delete"
onClick={(e) => {
chrome.tabs.update({
url: 'https://github.com/arch-org/mistake',
});
e.preventDefault();
this.removeall();
}}
>
<GitHubIcon style={{ fontSize: 'large' }} />
<DeleteSweepIcon style={{ fontSize: 'large' }} />
</IconButton>
</div>
</div>
Expand Down

0 comments on commit 7d2d094

Please sign in to comment.