Cleanup last commit
This commit is contained in:
@@ -44,15 +44,6 @@ export function Settings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Clean up function to reset state
|
// Clean up function to reset state
|
||||||
const cleanupState = () => {
|
|
||||||
if (eventSource) {
|
|
||||||
eventSource.close();
|
|
||||||
setEventSource(null);
|
|
||||||
}
|
|
||||||
setIsUpdating(false);
|
|
||||||
setIsImporting(false);
|
|
||||||
setProgress(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCancel = async () => {
|
const handleCancel = async () => {
|
||||||
// Just clean up everything immediately
|
// Just clean up everything immediately
|
||||||
@@ -91,7 +82,7 @@ export function Settings() {
|
|||||||
// Add event listeners for all SSE events
|
// Add event listeners for all SSE events
|
||||||
source.onopen = () => {};
|
source.onopen = () => {};
|
||||||
|
|
||||||
source.onerror = (error) => {
|
source.onerror = () => {
|
||||||
if (source.readyState === EventSource.CLOSED) {
|
if (source.readyState === EventSource.CLOSED) {
|
||||||
source.close();
|
source.close();
|
||||||
setEventSource(null);
|
setEventSource(null);
|
||||||
@@ -210,7 +201,7 @@ export function Settings() {
|
|||||||
// Add event listeners for all SSE events
|
// Add event listeners for all SSE events
|
||||||
source.onopen = () => {};
|
source.onopen = () => {};
|
||||||
|
|
||||||
source.onerror = (error) => {
|
source.onerror = () => {
|
||||||
if (source.readyState === EventSource.CLOSED) {
|
if (source.readyState === EventSource.CLOSED) {
|
||||||
source.close();
|
source.close();
|
||||||
setEventSource(null);
|
setEventSource(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user