Skip to content

Commit

Permalink
Fix sharing folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Jul 16, 2022
1 parent d3b5c65 commit 8db475d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions apps/ui/assets/components/MarkDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<pre><code class="language-markdown line-numbers" ref="code"><slot></slot></code></pre>
</template>
<script lang="ts">
// import Prism from '../prism.js';
const Prism = window['Prism'];
console.log('Prism', Prism);
const url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/;
const email = /\b\S+@[\w.]+[a-z]{2}/;
Expand Down
6 changes: 5 additions & 1 deletion apps/ui/assets/pages/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export default {
})
});
const json = await response.json();
await this.$router.push({ name: 'drive', params: { driveId: json.drive_id } });
if (json.driveId) {
await this.$router.push({ name: 'drive', params: { driveId: json.driveId } });
} else {
alert('Error sharing drive');
}
}
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/containers/server/ServerContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,16 @@ export class ServerContainer extends Container {
const folderUrl = req.body.url;
const driveId = urlToFolderId(folderUrl);

const folderRegistryContainer = <FolderRegistryContainer>this.engine.getContainer('folder_registry');
const folder = await folderRegistryContainer.registerFolder(driveId);

// const googleAuthService = new GoogleAuthService();
// const authConfig: AuthConfig = this.authContainer['authConfig'];
// const auth = await googleAuthService.authorizeUserAccount(authConfig.web_account.client_id, authConfig.web_account.client_secret);
// const authUrl = await googleAuthService.getWebAuthUrl(auth, serverUrl + '/api/share_drive', driveId);
// console.log('google_auth', authUrl);

res.json({ drive_id: driveId });
res.json(folder);
} catch (err) {
next(err);
}
Expand Down

0 comments on commit 8db475d

Please sign in to comment.