mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 10:28:32 +00:00
fix(web): close connection failed alert on successful request (#6657)
This commit is contained in:
@@ -23,8 +23,8 @@ export const RPC = {
|
|||||||
export class Remote {
|
export class Remote {
|
||||||
// TODO: decouple from controller
|
// TODO: decouple from controller
|
||||||
constructor(controller) {
|
constructor(controller) {
|
||||||
|
this._connection_alert = null;
|
||||||
this._controller = controller;
|
this._controller = controller;
|
||||||
this._error = '';
|
|
||||||
this._session_id = '';
|
this._session_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +56,8 @@ export class Remote {
|
|||||||
if (callback) {
|
if (callback) {
|
||||||
callback.call(context, payload, response_argument);
|
callback.call(context, payload, response_argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._connection_alert = null;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.message === Remote._SessionHeader) {
|
if (error.message === Remote._SessionHeader) {
|
||||||
@@ -66,13 +68,15 @@ export class Remote {
|
|||||||
}
|
}
|
||||||
console.trace(error);
|
console.trace(error);
|
||||||
this._controller.togglePeriodicSessionRefresh(false);
|
this._controller.togglePeriodicSessionRefresh(false);
|
||||||
this._controller.setCurrentPopup(
|
|
||||||
new AlertDialog({
|
this._connection_alert = new AlertDialog({
|
||||||
heading: 'Connection failed',
|
heading: 'Connection failed',
|
||||||
message:
|
message:
|
||||||
'Could not connect to the server. You may need to reload the page to reconnect.',
|
'Could not connect to the server. You may need to reload the page to reconnect.',
|
||||||
}),
|
});
|
||||||
);
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this._controller.setCurrentPopup(this._connection_alert);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user