Problem
A single-page application running in io.Connect Desktop. The app opens correctly, but if the user presses F5, the window refreshes and the app may fail to load.
In an observed case, the app launched successfully from index.html, but after refresh the window attempted to load the current in-app route directly instead of index.html. The result was an error similar to:
-6 The file or directory cannot be found.
Answer
You can disable refresh via the F5 key by setting disableRefreshOnF5 to true in the app definition, under details:
{
"name": "my-spa",
"type": "window",
"details": {
"url": "https://example.com/index.html",
"disableRefreshOnF5": true
}
}
- You can find
disableRefreshOnF5in the io.Connect Desktop application configuration schema (under thewindowdefinition) with the description: “Iftrue, the user cannot refresh the window.” - The same property also exists in the system configuration schema, where it defaults to
false. - This setting only disables refresh via the
F5key. It does not change the underlying loading or routing behavior of the app itself.