refactoring, tab switching handling shouldn't be on the widget level

This commit is contained in:
zadam
2023-09-13 09:01:55 +02:00
parent 7848c7e319
commit d46801ff1f
9 changed files with 553 additions and 52 deletions

View File

@@ -1388,7 +1388,7 @@ larger amounts of data and generally not accessible to the user.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line134">line 134</a>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line139">line 139</a>
</li></ul></dd>
@@ -1770,7 +1770,7 @@ larger amounts of data and generally not accessible to the user.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line119">line 119</a>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line124">line 124</a>
</li></ul></dd>
@@ -2815,7 +2815,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line129">line 129</a>
<a href="becca_entities_battachment.js.html">becca/entities/battachment.js</a>, <a href="becca_entities_battachment.js.html#line134">line 134</a>
</li></ul></dd>

View File

@@ -132,7 +132,12 @@ class BAttachment extends AbstractBeccaEntity {
}
decrypt() {
if (this.isProtected &amp;&amp; !this.isDecrypted &amp;&amp; protectedSessionService.isProtectedSessionAvailable()) {
if (!this.isProtected || !this.attachmentId) {
this.isDecrypted = true;
return;
}
if (!this.isDecrypted &amp;&amp; protectedSessionService.isProtectedSessionAvailable()) {
try {
this.title = protectedSessionService.decryptString(this.title);
this.isDecrypted = true;