diff --git a/apps/ssb.json b/apps/ssb.json
index 5b36f263..4726abdf 100644
--- a/apps/ssb.json
+++ b/apps/ssb.json
@@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🐌",
- "previous": "&xsmsLytB3VvoHphiFHZGGEvrCfTEVGXrGwobGTIYFPQ=.sha256"
+ "previous": "&6oHPQCA26v+4nBXv+YUdCT43j2DpXDspxhHSSRydkiw=.sha256"
}
diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js
index ec5588f9..282e4134 100644
--- a/apps/ssb/tf-tab-search.js
+++ b/apps/ssb/tf-tab-search.js
@@ -5,6 +5,7 @@ import {styles} from './tf-styles.js';
class TfTabSearchElement extends LitElement {
static get properties() {
return {
+ drafts: {type: Object},
whoami: {type: String},
users: {type: Object},
following: {type: Array},
@@ -22,6 +23,10 @@ class TfTabSearchElement extends LitElement {
this.users = {};
this.following = [];
this.expanded = {};
+ this.drafts = {};
+ tfrpc.rpc.localStorageGet('drafts').then(function (d) {
+ self.drafts = JSON.parse(d || '{}');
+ });
}
async search(query) {
@@ -70,6 +75,18 @@ class TfTabSearchElement extends LitElement {
}
}
+ draft(event) {
+ let id = event.detail.id || '';
+ let previous = this.drafts[id];
+ if (event.detail.draft !== undefined) {
+ this.drafts[id] = event.detail.draft;
+ } else {
+ delete this.drafts[id];
+ }
+ this.drafts = Object.assign({}, this.drafts);
+ tfrpc.rpc.localStorageSet('drafts', JSON.stringify(this.drafts));
+ }
+
render() {
if (this.query !== this.last_query) {
this.last_query = this.query;
@@ -81,7 +98,7 @@ class TfTabSearchElement extends LitElement {
-
+
`;
}
}