improvements

This commit is contained in:
Mateusz Gruszczyński
2026-08-05 09:53:28 +02:00
parent 248f4a3977
commit a9911da9a3
42 changed files with 1667 additions and 728 deletions
+19 -1
View File
@@ -1332,6 +1332,24 @@ export function startNoteEditor(adapter) {
onLatency: updateLatency,
onDiagnostics: renderConnectionDiagnostics,
onChat: appendChatMessage,
onPasswordRequired: async () => {
resourceUnlocked = false;
info = { ...info, protected: true, access_level: "none", can_set_password: false };
updatePageControls();
clearTimeout(saveTimer);
saveState.textContent = collaboration.hasPending()
? "Password required — pending changes kept"
: "Password required";
setDocumentReadOnly(true, "Password required");
document.querySelector("#password-error").textContent = "A password was set for this note. Enter it to continue.";
if (!passwordDialog.open) passwordDialog.showModal();
document.querySelector("#open-password")?.focus();
try {
await loadNoteInfo();
adapter.configureView?.(info);
updatePageControls();
} catch { }
},
onError: message => {
hideConnectionNotice();
const friendly = /read-only access/i.test(message) ? "This note is read only. Enter the password or ask the owner to grant write access." : message;
@@ -1932,7 +1950,7 @@ export function startNoteEditor(adapter) {
const submit = setPagePasswordForm.querySelector('button[type="submit"]');
submit.disabled = true;
try {
await adapter.setPassword(passwordValue);
await adapter.setPassword(passwordValue, collaborationClientId);
const access = await adapter.requestAccess(passwordValue);
setAccessToken(adapter.access.kind, adapter.access.key, access.granted);
accessToken = getAccessToken(adapter.access.kind, adapter.access.key) || shareToken;