mirror of
https://github.com/transmission/transmission
synced 2024-12-22 07:42:37 +00:00
fix(web): close connection failed alert on successful request (#6657)
This commit is contained in:
parent
dc1dc5b6b0
commit
250f43ae68
1 changed files with 12 additions and 8 deletions
|
@ -23,8 +23,8 @@ export const RPC = {
|
|||
export class Remote {
|
||||
// TODO: decouple from controller
|
||||
constructor(controller) {
|
||||
this._connection_alert = null;
|
||||
this._controller = controller;
|
||||
this._error = '';
|
||||
this._session_id = '';
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,8 @@ export class Remote {
|
|||
if (callback) {
|
||||
callback.call(context, payload, response_argument);
|
||||
}
|
||||
|
||||
this._connection_alert = null;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.message === Remote._SessionHeader) {
|
||||
|
@ -66,13 +68,15 @@ export class Remote {
|
|||
}
|
||||
console.trace(error);
|
||||
this._controller.togglePeriodicSessionRefresh(false);
|
||||
this._controller.setCurrentPopup(
|
||||
new AlertDialog({
|
||||
heading: 'Connection failed',
|
||||
message:
|
||||
'Could not connect to the server. You may need to reload the page to reconnect.',
|
||||
}),
|
||||
);
|
||||
|
||||
this._connection_alert = new AlertDialog({
|
||||
heading: 'Connection failed',
|
||||
message:
|
||||
'Could not connect to the server. You may need to reload the page to reconnect.',
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
this._controller.setCurrentPopup(this._connection_alert);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue