Skip to content

Commit

Permalink
fix: add functionality to empty local db
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkynrg committed Aug 15, 2024
1 parent 91acd37 commit 016f9ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/components/HomesList/HomesList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@
padding: 16px;

.ResultCounter {
margin: 0 4px;
margin-right: 4px;
}

.NewRequestLink {
text-decoration: none;
color: #1890FF;
margin-right: 4px;
cursor: pointer;
}
.EmptyDB {
text-decoration: none;
color: #1890FF;
margin-right: 4px;
cursor: pointer;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/HomesList/HomesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ const HomesList = ({
Risultati |
</span>
<Link className={style.NewRequestLink} to="/request">
Richiedi altre cittá
Richiedi altre cittá |
</Link>
<span className={style.EmptyDB} onClick={() => db.homes.clear()}>
Svuota local DB
</span>
</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const Loader = ({
axios.get<JobsResponse>(`/v1/jobs/${jobUUID}`).then((response) => {
setStatus('progress')
if (response.data.finished) {
// db.homes.clear()
db.homes.bulkPut(response.data.result)
setRequest(null)
navigate('/listing')
Expand Down

0 comments on commit 016f9ab

Please sign in to comment.