mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
fix: removing wheel reinvention of urlStates
This commit is contained in:
parent
fbc911721e
commit
2f2f50488f
@ -333,14 +333,12 @@ export class DocSettingsPage extends Disposable {
|
|||||||
docType = "tutorial";
|
docType = "tutorial";
|
||||||
}
|
}
|
||||||
await persistType(docType, docId);
|
await persistType(docType, docId);
|
||||||
const currentUrl = window.location.href;
|
const {trunkId} = docPageModel.currentDoc.get()!.idParts;
|
||||||
const urlId = currentUrl.split("/docs/")[1];
|
window.location.replace(urlState().makeUrl({
|
||||||
const cleanUrlId = urlId.match(/^doc\/.*/) ? urlId.split("/")[1] : urlId.split("/")[0];
|
docPage: "settings",
|
||||||
const shortDocId = urlId?.split("~")[0];
|
fork: undefined, // will be automatically set once the page is reloaded
|
||||||
const reloadUrl = urlId.match(/^doc\/.*/) ?
|
doc: trunkId,
|
||||||
currentUrl.replace(`doc/${cleanUrlId}`, shortDocId) :
|
}));
|
||||||
currentUrl.replace(cleanUrlId, shortDocId);
|
|
||||||
window.location.replace(reloadUrl ?? "");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const documentTypeOptions = () => [
|
const documentTypeOptions = () => [
|
||||||
|
Loading…
Reference in New Issue
Block a user