Add rehashStreams method to API and update SettingsPage to trigger stream rehash

This commit is contained in:
SergeantPanda 2025-07-11 16:38:20 -05:00
parent 34a3f75c1c
commit 3a60526fbd
2 changed files with 14 additions and 2 deletions

View file

@ -1463,4 +1463,16 @@ export default class API {
errorNotification('Failed to delete user', e);
}
}
static async rehashStreams() {
try {
const response = await request(`${host}/api/core/rehash-streams/`, {
method: 'POST',
});
return response;
} catch (e) {
errorNotification('Failed to trigger stream rehash', e);
}
}
}

View file

@ -250,9 +250,9 @@ const SettingsPage = () => {
const onRehashStreams = async () => {
setRehashingStreams(true);
setRehashSuccess(false);
try {
await API.post('/core/rehash-streams/');
await API.rehashStreams();
setRehashSuccess(true);
setTimeout(() => setRehashSuccess(false), 5000); // Clear success message after 5 seconds
} catch (error) {