Skip to content

Commit

Permalink
fixed a few bugs while reviewing pr
Browse files Browse the repository at this point in the history
  • Loading branch information
polluterofminds committed Jul 16, 2019
1 parent 004b380 commit bf03d11
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 86 deletions.
162 changes: 82 additions & 80 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/components/docs/helpers/publicDoc.js
Expand Up @@ -3,11 +3,12 @@ import { Value } from 'slate';
const axios = require('axios');
const blockstack = require('blockstack');
export function fetchData(){
const user = window.location.href.split('docs/')[1].split('-')[0];
const user = window.location.href.split('docs/')[1].split('&id=')[0];
blockstack.lookupProfile(user, "https://core.blockstack.org/v1/names")
.then((profile) => {
setGlobal({ url: profile.apps[window.location.origin]}, () => {
const id = window.location.href.split('docs/')[1].split('-')[1].split('#')[0]
const id = window.location.href.split('docs/')[1].split('&id=')[1].split('#')[0]
console.log(id);
axios.get(`${getGlobal().url}public/${id}.json`)
.then((response) => {
console.log(response)
Expand Down Expand Up @@ -50,7 +51,7 @@ export function handlePubChange(change) {
}

export function pollForChanges() {
const user = window.location.href.split('docs/')[1].split('-')[0];
const user = window.location.href.split('docs/')[1].split('&id=')[0];
blockstack.lookupProfile(user, "https://core.blockstack.org/v1/names")
.then((profile) => {
setGlobal({ url: profile.apps[window.location.origin]}, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/helpers/shareDoc.js
Expand Up @@ -83,7 +83,7 @@ export function sharePublicly(params) {
window.location.href.includes("new") ? id = window.location.href.split("new/")[1] : id = window.location.href.split("documents/")[1];
const directory = "public/";
const file = directory + id + ".json";
const link = `${window.location.origin}/shared/docs/${user}-${id}`;
const link = `${window.location.origin}/shared/docs/${user}&id=${id}`;

try {
let pubDocParams = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/views/editor/MenuBar.js
Expand Up @@ -244,7 +244,7 @@ export default class MenuBar extends React.Component {
{singleDoc.readOnly === true ? "This shared document is read-only." : "This shared document is editable."}
</p>
<div>
<p><a href={`${window.location.origin}/shared/docs/${userSession.loadUserData().username}-${docId}`}>{`${window.location.origin}/shared/docs/${userSession.loadUserData().username}-${docId}`}</a></p>
<p><a href={`${window.location.origin}/shared/docs/${userSession.loadUserData().username}&id=${docId}`}>{`${window.location.origin}/shared/docs/${userSession.loadUserData().username}&id=${docId}`}</a></p>
</div>
</div>
:
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/views/editor/SocketEditor.js
Expand Up @@ -45,7 +45,7 @@ class SocketEditor extends Component {
if(window.location.href.includes('docInfo')) {
room = room = window.location.href.split('id=')[1];
} else if(window.location.href.includes('shared')) {
room = window.location.href.split('shared/docs/')[1].split('-')[1]
room = window.location.href.split('shared/docs/')[1].split('&id=')[1]
} else {
if(window.location.href.includes("new")) {
room = window.location.href.split("new/")[1];
Expand Down

0 comments on commit bf03d11

Please sign in to comment.