Merge pull request #2176 from Luis-Fernando-Molina/develop
Contribution: Desktop: Code comments and some fixes
This commit is contained in:
3 files changed
+23
-4
No files matched your search
@@ -1,5 +1,9 @@
|
||||
function newWebApp() {
|
||||
/*
|
||||
In it's current state of development, the Web App only has one module.
|
||||
|
||||
Everything is being coded here until some structure emerges.
|
||||
*/
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
@@ -123,7 +127,6 @@ function newWebApp() {
|
||||
function addToContentDiv(events) {
|
||||
try {
|
||||
let contentDiv = document.getElementById('content-div')
|
||||
|
||||
/*
|
||||
Delete al current content.
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModulesWebAppInterface() {
|
||||
/*
|
||||
This module handles the incomming messages from the Web App.
|
||||
At it's current iteration, it will jusr forward those messages
|
||||
At it's current version, it will jusr forward those messages
|
||||
to the Network Node it is connected to.
|
||||
|
||||
Later, it will try to use the personal social graph as a cache,
|
||||
so as to minimize the requests to Network Nodes.
|
||||
*/
|
||||
let thisObject = {
|
||||
messageReceived: messageReceived,
|
||||
@@ -144,6 +147,14 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
|
||||
}
|
||||
|
||||
async function savePostAtStorage(postText, commitMessage, timestamp) {
|
||||
/*
|
||||
Each user, has a git repository that acts as his publicly accesible
|
||||
storage for posts.
|
||||
|
||||
They way we store post there is first saving the data at the local disk
|
||||
which has a clone of the remote git repository, and once done, we push
|
||||
the changes to the public git repo.
|
||||
*/
|
||||
const { createHash } = await import('crypto')
|
||||
const hash = createHash('sha256')
|
||||
let post = {
|
||||
@@ -174,6 +185,12 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
|
||||
}
|
||||
|
||||
async function getPostText(userProfileHandle, postHash, timestamp) {
|
||||
/*
|
||||
When the Web App makes a query that includes Post text as responses,
|
||||
we need to fetch the text from the public git repositories, since
|
||||
the Network Nodes do not store that info themselves, they just
|
||||
store the structure of the social graph.
|
||||
*/
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
|
||||
const fileName = postHash + ".json"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
exports.newDesktopModulesHttpInterface = function newDesktopModulesHttpInterface() {
|
||||
|
||||
/*
|
||||
This module represent the HTTP API of the
|
||||
Desktop App. All HTTP request are processed
|
||||
Desktop App Client. All HTTP request are processed
|
||||
by this module.
|
||||
*/
|
||||
let thisObject = {
|
||||
|
||||
Reference in new issue
Block a user