Skip to content

Commit

Permalink
refactor: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jul 16, 2023
1 parent bbd2f9a commit c1987b8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/util/urlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ function constructSheetUrl(sheetName) {
}

function getDocumentOrSheetId() {
const queryString = window.location.href.match(/documentId(.*)/) ?? window.location.href.match(/sheetId(.*)/)
const queryParams = queryString ? QueryParams(queryString[0]) : {}
const queryParams = QueryParams(window.location.search.substring(1))

return queryParams.documentId ?? queryParams.sheetId
}

function getSheetName() {
const queryString = window.location.href.match(/sheetName(.*)/)
const queryParams = queryString ? QueryParams(queryString[0]) : {}
const queryParams = QueryParams(window.location.search.substring(1))

return queryParams.sheetName
}
Expand Down

0 comments on commit c1987b8

Please sign in to comment.