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