upload of modified open file WIP

This commit is contained in:
zadam
2021-04-24 11:39:44 +02:00
parent 6d2d72fa7f
commit 4ff7e0813d
11 changed files with 82 additions and 26 deletions

View File

@@ -0,0 +1,31 @@
import ws from "./ws.js";
import appContext from "./app_context.js";
const fileModificationStatus = {};
function getFileModificationStatus(noteId) {
return fileModificationStatus[noteId];
}
function fileModificationUploaded(noteId) {
delete fileModificationStatus[noteId];
}
ws.subscribeToMessages(async message => {
if (message.type !== 'openedFileUpdated') {
return;
}
fileModificationStatus[message.noteId] = message;
appContext.triggerEvent('openedFileUpdated', {
noteId: message.noteId,
lastModifiedMs: message.lastModifiedMs,
filePath: message.filePath
});
});
export default {
getFileModificationStatus,
fileModificationUploaded
}