I am using the Blazor server-side.
When the Blazor App disconnect to the remote server, it will shows this:
I want to change the text (\'Could not
For the javascript side of things Blazor exposes a tiny API via the window.Blazor object.
One part of this API is the defaultReconnectionHandler which allows you to customize the reconnection experience including setting different options for the number of retrys etc.
However, it is also possible to just swap out the logic for displaying the ReconnectionDisplay
A simple implemenation looks like this and enables you to to get controll over the process:
function createOwnDisplay() {
return {
show: () => { alert("put code that shows a toast , ui, or whaterver here"); },
hide: () => { console.log('foo'); },
failed: () => { console.log('foo'); },
rejected: () => { console.log('foo'); }
};
}
Blazor.defaultReconnectionHandler._reconnectionDisplay = createOwnDisplay();