ui: fix bookmark refresh, fix userState used param for update

This commit is contained in:
nick-delirium 2024-10-30 13:16:30 +01:00
parent 63d1b8ab49
commit 5312d27693
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 7 additions and 14 deletions

View file

@ -110,12 +110,6 @@ function SessionList() {
}
}, [statusData, siteId]);
// useEffect(() => {
// if (siteId) {
// void searchStore.fetchSessions();
// }
// }, [siteId]);
useEffect(() => {
const id = setInterval(() => {
if (!document.hidden) {
@ -130,12 +124,6 @@ function SessionList() {
const { scrollY } = searchStore;
window.scrollTo(0, scrollY);
// if (total === 0 && !loading && !hasNoRecordings) {
// setTimeout(() => {
// void searchStore.fetchSessions();
// }, 100);
// }
return () => {
searchStore.setScrollPosition(window.scrollY);
};
@ -205,7 +193,9 @@ function SessionList() {
className="mt-4"
icon="arrow-repeat"
iconSize={20}
onClick={() => searchStore.fetchSessions(true)}
onClick={() => {
void searchStore.fetchSessions(true, isBookmark);
}}
>
Refresh
</Button>

View file

@ -496,7 +496,10 @@ class UserStore {
try {
await userService.updateClient(params);
runInAction(() => {
this.client = new Client({ ...this.client, ...params });
Object.keys(params).forEach((key) => {
this.client[key] = params[key];
this.account[key] = params[key];
})
});
} catch (error) {
// TODO error handling