forked from snxraven/LinkUp-P2P-Chat
add debug, last try for now
This commit is contained in:
parent
d5ea2abb7a
commit
5ff2460d23
12
app.js
12
app.js
@ -121,10 +121,14 @@ async function initialize() {
|
||||
await drive.put(`/icons/${username}.png`, avatarBuffer);
|
||||
updateIcon(username, avatarBuffer);
|
||||
} else if (messageObj.type === 'file') {
|
||||
const fileBuffer = Buffer.from(messageObj.fileData, 'base64');
|
||||
await drive.put(messageObj.filePath, fileBuffer);
|
||||
const fileUrl = `http://localhost:${servePort}${messageObj.filePath}`;
|
||||
addFileMessage(messageObj.name, messageObj.fileName, fileUrl, messageObj.fileType, messageObj.avatar);
|
||||
try {
|
||||
const fileBuffer = Buffer.from(messageObj.fileData, 'base64');
|
||||
await drive.put(messageObj.filePath, fileBuffer);
|
||||
const fileUrl = `http://localhost:${servePort}${messageObj.filePath}`;
|
||||
addFileMessage(messageObj.name, messageObj.fileName, fileUrl, messageObj.fileType, messageObj.avatar);
|
||||
} catch (error) {
|
||||
console.error('Error putting file:', error);
|
||||
}
|
||||
} else {
|
||||
onMessageAdded(messageObj.name, messageObj.message, messageObj.avatar);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user