Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Fix for creating new pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tchojnacki committed Aug 12, 2018
1 parent 8e4f0ac commit 7bd480b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class FMEditor {
}

async getPageContent (newest) {
if (this.bgData.revid === 0) {
return ''
}
const response = await window.fetch(`${this.bgData.api}/api.php?format=json&action=query&prop=revisions&rvprop=content&` + (newest ? `titles=${this.bgData.title}&cb=${new Date().getTime() / 1000}` : `revids=${this.bgData.revid}`))
const json = await response.json()
const content = json.query.pages[Object.keys(json.query.pages)[0]].revisions ? json.query.pages[Object.keys(json.query.pages)[0]].revisions[0]['*'] : ''
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"manifest_version": 2,
"name": "FANDOM Monaco",
"version": "1.2.1",
"version": "1.2.2",
"description": "Integrate Monaco Editor into FANDOM.",
"background": {
"scripts": [
Expand Down

0 comments on commit 7bd480b

Please sign in to comment.