Skip to content

Commit

Permalink
Replace window.location.assign with urlState
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepyLeslie committed Aug 21, 2024
1 parent 7086885 commit 997694d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/app/client/ui/NewDocMethods.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HomeModel } from 'app/client/models/HomeModel';
import { electronOnly } from "app/client/electronOnly";
import { homeImports } from 'app/client/ui/HomeImports';
import { urlState } from 'app/client/models/gristUrlState';

async function createDocAndOpen() {
electronOnly();
Expand All @@ -22,7 +23,7 @@ async function _importDocAndOpen(home: HomeModel, fileToImport?: File) {
if (uploadId === null) { return; }
const doc = await window.electronAPI.importDoc(uploadId);
if (doc) {
window.location.assign("/o/docs/" + doc.id);
urlState().pushUrl({doc: doc.id});
}
}

Expand Down

0 comments on commit 997694d

Please sign in to comment.