Encrypt wiki docs to all editors..

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4661 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-12-06 17:48:44 +00:00
parent eb3c9cd6f3
commit f0984b19f2
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "📝",
"previous": "&2z1RieeV0Kxp9DoT1Jor5tKImA3n4Sh4Dar0+BZpQxY=.sha256"
"previous": "&kjbXfJac0FNZnkr+TlnKjbJOQ/Ktw5C/TWjXu/i6IWs=.sha256"
}

View File

@ -6,7 +6,7 @@ class TfWikiDocElement extends LitElement {
static get properties() {
return {
whoami: {type: String},
wiki: {type: String},
wiki: {type: Object},
value: {type: Object},
blob: {type: String},
blob_original: {type: String},
@ -67,7 +67,7 @@ class TfWikiDocElement extends LitElement {
async append_message(draft) {
let blob = this.blob;
if (draft || this.value?.private) {
blob = await tfrpc.rpc.encrypt(this.whoami, this.value.editors, blob);
blob = await tfrpc.rpc.encrypt(this.whoami, this.wiki.editors, blob);
}
let id = await tfrpc.rpc.store_blob(blob);
let message = {
@ -179,7 +179,7 @@ class TfWikiDocElement extends LitElement {
<button ?disabled=${!this.is_editing} @click=${this.on_discard}>Discard</button>
<button ?disabled=${!this.is_editing} @click=${() => self.value = Object.assign({}, self.value, {private: !self.value.private})}>${this.value?.private ? 'Make Public' : 'Make Private'}</button>
</div>
<div ?hidden=${!this.value?.private} style="color: #800">document is private</div>
<div ?hidden=${!this.value?.private} style="color: #800">🔒 document is private</div>
<div style="display: flex; flex-direction: row; ${this.value?.private ? 'border-top: 4px solid #800' : ''}">
<textarea
?hidden=${!this.is_editing}
@ -193,4 +193,4 @@ class TfWikiDocElement extends LitElement {
}
}
customElements.define('tf-wiki-doc', TfWikiDocElement);
customElements.define('tf-wiki-doc', TfWikiDocElement);