(core) Treating API urls as external in cells

Summary:
Links for the API endpoints in a cell didn't work as they were interpreted as
internal routes. Now they are properly detected as external.

Test Plan: Added new test

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D4078
This commit is contained in:
Jarosław Sadziński
2023-10-17 18:31:33 +02:00
parent 77726849ad
commit 69d5ee53a8
5 changed files with 50 additions and 8 deletions

View File

@@ -188,6 +188,9 @@ export class UrlStateImpl {
* a matter of DocWorker requiring a different version (e.g. /v/OTHER/doc/...).
*/
public needPageLoad(prevState: IGristUrlState, newState: IGristUrlState): boolean {
// If we have an API URL we can't use it to switch the state, so we need a page load.
if (newState.api || prevState.api) { return true; }
const gristConfig = this._window.gristConfig || {};
const orgReload = prevState.org !== newState.org;
// Reload when moving to/from a document or between doc and non-doc.