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);
|
await drive.put(`/icons/${username}.png`, avatarBuffer);
|
||||||
updateIcon(username, avatarBuffer);
|
updateIcon(username, avatarBuffer);
|
||||||
} else if (messageObj.type === 'file') {
|
} else if (messageObj.type === 'file') {
|
||||||
const fileBuffer = Buffer.from(messageObj.fileData, 'base64');
|
try {
|
||||||
await drive.put(messageObj.filePath, fileBuffer);
|
const fileBuffer = Buffer.from(messageObj.fileData, 'base64');
|
||||||
const fileUrl = `http://localhost:${servePort}${messageObj.filePath}`;
|
await drive.put(messageObj.filePath, fileBuffer);
|
||||||
addFileMessage(messageObj.name, messageObj.fileName, fileUrl, messageObj.fileType, messageObj.avatar);
|
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 {
|
} else {
|
||||||
onMessageAdded(messageObj.name, messageObj.message, messageObj.avatar);
|
onMessageAdded(messageObj.name, messageObj.message, messageObj.avatar);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user